/**
 * TagDiary Web UI Stylesheet (Dark Glassmorphic Theme)
 */

.td-web-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #f8fafc;
    box-sizing: border-box;
}

.td-web-container * {
    box-sizing: border-box;
}

/* Glassmorphic Card Container */
.td-glass-card {
    background-color: #151d30;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.td-login-card {
    max-width: 420px;
    margin: 40px auto;
}

/* Landing Page Hero Card */
.td-landing-card {
    max-width: 680px;
    margin: 20px auto;
    text-align: center;
    padding: 32px 24px;
}

.td-landing-hero .td-header-title {
    margin-bottom: 16px;
}

.td-landing-title {
    font-size: 24px;
    font-weight: 700;
    color: #f8fafc;
    margin: 12px 0 8px 0;
}

.td-landing-description {
    font-size: 15px;
    color: #94a3b8;
    line-height: 1.5;
    max-width: 540px;
    margin: 0 auto 28px auto;
}

.td-landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    text-align: left;
}

.td-feature-item {
    background-color: #0b0f19;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
}

.td-feature-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.td-feature-item h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
}

.td-feature-item p {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

.td-landing-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.td-btn-lg {
    padding: 12px 24px;
    font-size: 15px;
    text-decoration: none;
}

/* Modal Overlay & Card */
.td-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.td-modal-card {
    width: 100%;
    max-width: 580px;
    margin: 0;
    animation: td-modal-pop 0.2s ease-out;
}

.td-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

@keyframes td-modal-pop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Auth Tabs & Toggle */
.td-tab-group {
    display: flex;
    background-color: #0b0f19;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

.td-tab-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.td-tab-btn.active {
    background-color: #1a233a;
    color: #3b82f6;
}

.td-auth-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #94a3b8;
}

.td-auth-toggle a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}

.td-auth-toggle a:hover {
    text-decoration: underline;
}

/* Headers & Typography */
.td-header-title {
    text-align: center;
    margin-bottom: 24px;
}

.td-logo {
    color: #3b82f6;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.td-logo-sm {
    color: #3b82f6;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.td-subtitle {
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
}

.td-card-title {
    color: #f8fafc;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

/* App Header Bar */
.td-app-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.td-user-info {
    display: flex;
    flex-direction: column;
}

.td-user-name {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 2px;
}

.td-app-actions {
    display: flex;
    gap: 8px;
}

/* Form Controls */
.td-form-group {
    margin-bottom: 16px;
}

.td-form-group label {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.td-input,
.td-textarea {
    width: 100%;
    padding: 12px;
    background-color: #0b0f19;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.td-input:focus,
.td-textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Chrome/Edge Autofill Background Override */
.td-input:-webkit-autofill,
.td-input:-webkit-autofill:hover,
.td-input:-webkit-autofill:focus,
.td-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #0b0f19 inset !important;
    -webkit-text-fill-color: #f8fafc !important;
    caret-color: #f8fafc;
    transition: background-color 5000s ease-in-out 0s;
}

.td-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Note Footer & Character Counter */
.td-note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.td-shortcut-hint {
    color: #64748b;
    font-size: 12px;
}

.td-footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.td-char-count {
    color: #64748b;
    font-size: 13px;
}

.td-char-count.warning {
    color: #f59e0b;
    font-weight: 600;
}

.td-char-count.error {
    color: #ef4444;
    font-weight: 700;
}

/* Buttons */
.td-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.td-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.td-btn-primary {
    width: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    color: #ffffff;
}

.td-btn-success {
    background: linear-gradient(90deg, #10b981, #3b82f6);
    color: #ffffff;
}

.td-btn-secondary {
    background-color: #1a233a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #3b82f6;
}

.td-btn-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 6px 12px;
    font-size: 12px;
}

.td-btn-icon {
    background-color: #1a233a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    width: 32px;
    height: 32px;
    padding: 0;
}

/* Alerts */
.td-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.td-alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Section Header */
.td-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 10px 4px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 700;
}

.td-section-bar {
    width: 4px;
    height: 16px;
    background-color: #3b82f6;
    border-radius: 2px;
}

/* Note Card */
.td-note-card {
    margin-bottom: 12px;
}

.td-note-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.td-note-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3b82f6;
}

.td-note-date {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
}

.td-note-body {
    color: #f8fafc;
    font-size: 15px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* States */
.td-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.td-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.td-empty-state h4 {
    margin: 0 0 6px 0;
    color: #f8fafc;
}

.td-empty-state p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
}

.td-loading-state {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
}

.td-spinner-lg {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: td-spin 0.8s linear infinite;
    margin: 0 auto 12px auto;
}

.td-pagination-wrapper {
    text-align: center;
    margin-top: 16px;
}

@keyframes td-spin {
    to { transform: rotate(360deg); }
}
