/* CSS Variables - Browser Style Theme */
:root {
    --primary-color: #FF8C5A;
    --primary-light: #FFAB85;
    --primary-dark: #E67632;
    --background-cream: #FFFBF5;
    --background-warm: #FFF3E0;
    --card-bg: #FFFFFF;
    --card-border: #F5E6D3;
    --text-primary: #3D3028;
    --text-secondary: #6B5D52;
    --text-muted: #9E9189;
    --success: #6BCB77;
    --danger: #FF6B6B;
    --warning: #FFD93D;
    --info: #4D96FF;
    --shadow: 0 2px 12px rgba(61, 48, 40, 0.08);
    --shadow-hover: 0 4px 20px rgba(61, 48, 40, 0.12);
    --border-radius: 16px;
    --border-radius-sm: 8px;

    /* Legacy support */
    --primary-orange: var(--primary-color);
    --primary-orange-light: var(--primary-light);
    --primary-orange-dark: var(--primary-dark);
    --background-gradient-start: var(--background-cream);
    --background-gradient-end: var(--background-warm);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(180deg, var(--background-cream) 0%, var(--background-warm) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* ==================== */
/* Background Animation */
/* ==================== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Floating circles */
.floating-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.floating-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    top: -100px;
    right: -100px;
    animation-delay: 0s;
    animation-duration: 25s;
}

.floating-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light), #FFD700);
    bottom: 20%;
    left: -80px;
    animation-delay: -5s;
    animation-duration: 20s;
}

.floating-circle:nth-child(3) {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #FFB6C1, var(--primary-light));
    top: 40%;
    right: 5%;
    animation-delay: -10s;
    animation-duration: 22s;
}

.floating-circle:nth-child(4) {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), #FF6B6B);
    bottom: 10%;
    right: 20%;
    animation-delay: -7s;
    animation-duration: 18s;
}

.floating-circle:nth-child(5) {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #98FB98, var(--primary-light));
    top: 20%;
    left: 15%;
    animation-delay: -12s;
    animation-duration: 23s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(20px, -30px) rotate(5deg) scale(1.05);
    }
    50% {
        transform: translate(-10px, 20px) rotate(-3deg) scale(0.95);
    }
    75% {
        transform: translate(15px, 10px) rotate(3deg) scale(1.02);
    }
}

/* Wave animation at bottom */
.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C300,100 600,20 900,60 C1200,100 1200,100 1200,100 L1200,120 L0,120 Z' fill='%23FF8C5A' fill-opacity='0.08'/%3E%3C/svg%3E") repeat-x;
    background-size: 50% 100%;
    animation: wave 15s linear infinite;
}

.wave:nth-child(2) {
    bottom: 10px;
    opacity: 0.5;
    animation-duration: 20s;
    animation-direction: reverse;
}

.wave:nth-child(3) {
    bottom: 20px;
    opacity: 0.3;
    animation-duration: 25s;
}

@keyframes wave {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* App Container - Full Width Browser Style */
.app-container {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Header - Browser Style with Navigation */
.app-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 24px;
    background: linear-gradient(135deg, #FF7B45 0%, var(--primary-color) 40%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(255, 123, 69, 0.35);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.app-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.25);
    padding: 8px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.header-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: rgba(255, 255, 255, 0.9);
    font-family: inherit;
}

.header-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateY(-1px);
}

.header-nav .nav-item.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

.header-nav .nav-icon {
    font-size: 1.2rem;
}

.header-nav .nav-label {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Main Content - Full Width Browser Style */
.main-content {
    flex: 1;
    padding: 24px;
    padding-bottom: 40px;
    overflow-y: auto;
    width: 100%;
}

/* Screen content centering */
.screen {
    max-width: 900px;
    margin: 0 auto;
}

/* Quote Cards Grid Layout for Desktop */
.quotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.quotes-grid .quote-card {
    margin-bottom: 0;
}

/* Legacy Bottom Navigation - Hidden (moved to header) */
.bottom-nav {
    display: none !important;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 6px 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    border-radius: var(--border-radius-sm);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-item:hover {
    color: var(--primary-color);
    background: rgba(255, 140, 90, 0.08);
}

.nav-icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 500;
}

/* Cards - Browser Style */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 2px;
}

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

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--card-border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.char-counter.warning {
    color: var(--danger);
}

/* Buttons - Browser Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 140, 90, 0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 90, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: var(--background-cream);
    border-color: var(--primary-light);
}

.btn-icon {
    padding: 8px;
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 140, 90, 0.1);
    color: var(--primary-color);
}

.btn-full {
    width: 100%;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #E55555;
}

/* Mood Tags */
.mood-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.mood-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 2px solid var(--card-border);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mood-tag:hover {
    border-color: var(--primary-orange-light);
}

.mood-tag.selected {
    background: var(--primary-orange);
    color: white;
    border-color: var(--primary-orange);
}

.mood-tag-icon {
    margin-right: 4px;
}

/* Quote Card - Browser Style */
.quote-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    position: relative;
    transition: all 0.2s ease;
}

.quote-card:hover {
    box-shadow: var(--shadow-hover);
}

.quote-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
}

.quote-text::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 0;
    width: 3px;
    height: calc(100% - 8px);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 2px;
}

.quote-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
    font-weight: 500;
}

.quote-source {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

.quote-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
}

.quote-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.quote-tag {
    font-size: 0.7rem;
    padding: 3px 10px;
    background: var(--background-warm);
    color: var(--text-secondary);
    border-radius: 12px;
}

.quote-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.quote-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Favorite Star */
.favorite-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.favorite-btn.active {
    opacity: 1;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .modal-content {
        padding: 40px;
        max-width: 650px;
    }
}

@media (min-width: 1024px) {
    .modal-content {
        max-width: 700px;
    }
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: var(--primary-orange);
    font-size: 1.4rem;
}

@media (min-width: 768px) {
    .modal-header h2 {
        font-size: 1.6rem;
    }
}

.modal-body {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 245, 235, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--card-border);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-text {
    color: var(--primary-orange-dark);
    font-size: 1rem;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.9rem;
}

/* Settings */
.settings-section {
    margin-bottom: 24px;
}

.settings-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-item:hover {
    background: white;
    box-shadow: var(--shadow);
}

.settings-item-label {
    font-size: 0.95rem;
}

.settings-item-value {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-orange);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--card-border);
    border-radius: 12px;
    font-size: 0.95rem;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-orange);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.filter-tab {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: white;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.filter-tab.active {
    background: var(--primary-orange);
    color: white;
}

/* Profile Section */
.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 16px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-orange-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    text-align: center;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 12px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-orange);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Responsive - Desktop First */
@media (min-width: 768px) {
    .main-content {
        padding: 32px 48px;
        padding-bottom: 40px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .onboarding-slide {
        max-width: 480px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 40px 60px;
        padding-bottom: 40px;
    }

    .screen {
        max-width: 1000px;
    }
}

@media (min-width: 1400px) {
    .main-content {
        padding: 48px 80px;
    }

    .screen {
        max-width: 1200px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .header-brand {
        position: static;
        transform: none;
    }

    .header-nav {
        position: static;
        width: 100%;
        justify-content: space-around;
    }

    .header-nav .nav-item {
        flex-direction: column;
        padding: 8px 12px;
        gap: 4px;
    }

    .header-nav .nav-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.3rem;
    }

    .main-content {
        padding: 12px;
        padding-bottom: 24px;
    }

    .card {
        padding: 16px;
    }

    .quotes-grid {
        grid-template-columns: 1fr;
    }

    .header-nav .nav-item {
        padding: 6px 8px;
    }

    .header-nav .nav-icon {
        font-size: 1rem;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 100px;
    left: 5%;
    right: 5%;
    transform: translateY(-100px);
    background: var(--text-primary);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    z-index: 400;
    opacity: 0;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    line-height: 1.5;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* ==================== */
/* New Features Styles  */
/* ==================== */

/* Onboarding Screen */
.onboarding-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
    background: linear-gradient(180deg, var(--background-cream) 0%, var(--background-warm) 100%);
}

.onboarding-slide {
    display: none;
    text-align: center;
    animation: fadeIn 0.4s ease;
    width: 100%;
    max-width: 320px;
}

.onboarding-slide.active {
    display: block;
}

.onboarding-icon {
    font-size: 4rem;
    margin-bottom: 24px;
}

.onboarding-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.onboarding-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.onboarding-profile-form {
    text-align: left;
    margin-top: 16px;
}

.onboarding-dots {
    display: flex;
    gap: 8px;
    margin: 32px 0;
}

.onboarding-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--card-border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-dots .dot.active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 4px;
}

.onboarding-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 320px;
}

.onboarding-actions .btn {
    flex: 1;
}

/* Tutorial Screen */
.tutorial-section {
    margin-bottom: 20px;
}

.tutorial-step {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--card-border);
}

.tutorial-step:last-child {
    border-bottom: none;
}

.tutorial-number {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.tutorial-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tutorial-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Legal Screen */
.legal-screen .card {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.legal-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.legal-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 8px;
}

.legal-content p {
    margin-bottom: 12px;
}

.legal-content ul {
    margin: 8px 0 16px 20px;
}

.legal-content li {
    margin-bottom: 4px;
}

/* Custom Tags Screen */
.custom-tag-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--background-cream);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

.custom-tag-actions {
    display: flex;
    gap: 8px;
}

.custom-tag-actions .btn-icon {
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.custom-tag-actions .btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Color Picker */
.color-picker-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--text-primary);
}

.tag-preview-container {
    padding: 16px;
    background: var(--background-cream);
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.tag-preview {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Report Modal */
.report-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.report-quote-preview {
    padding: 12px 16px;
    background: var(--background-cream);
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    font-style: italic;
    color: var(--text-muted);
}

.report-reasons {
    margin-bottom: 16px;
}

.report-reason-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-reason-item:hover {
    border-color: var(--primary-color);
    background: var(--background-cream);
}

.report-reason-item input[type="radio"] {
    margin-top: 2px;
    accent-color: var(--primary-color);
}

.report-reason-content {
    flex: 1;
}

.report-reason-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.report-reason-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.reported-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--background-warm);
    border-radius: 10px;
}

/* Custom Tag Styles */
.mood-tag.custom-tag {
    border: 2px solid var(--tag-color);
    background: white;
    color: var(--tag-color);
}

.mood-tag.custom-tag:hover {
    background: rgba(0, 0, 0, 0.03);
}

.mood-tag.custom-tag.selected {
    background: var(--tag-color);
    color: white;
    border-color: var(--tag-color);
}

/* Stats Grid - 4 columns for favorites */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.stat-card {
    text-align: center;
    padding: 14px 8px;
    background: var(--card-bg);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--card-border);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Settings Items - Browser Style */
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--card-bg);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--card-border);
}

.settings-item:hover {
    background: var(--background-cream);
    border-color: var(--primary-light);
}

/* Profile Card - Browser Style */
.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    border: 1px solid var(--card-border);
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
}

/* Mood Tags - Browser Style */
.mood-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mood-tag:hover {
    border-color: var(--primary-light);
    background: var(--background-cream);
}

.mood-tag.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Form inputs - Browser Style */
.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--card-bg);
    transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 140, 90, 0.1);
}

/* Search Box - Browser Style */
.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background: var(--card-bg);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 140, 90, 0.1);
}

/* Filter Tabs - Browser Style */
.filter-tab {
    padding: 8px 16px;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Modal - Browser Style */
.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: all 0.2s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

/* Loading Overlay - Browser Style */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 251, 245, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--card-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Profile Image Picker */
.profile-image-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.profile-image-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--background-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--card-border);
}

.profile-image-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image-placeholder {
    font-size: 2.5rem;
    opacity: 0.5;
}

.profile-image-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* Profile Avatar Image */
.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ==================== */
/* Home Screen - Flat Layout */
/* ==================== */

.home-screen {
    padding-bottom: 20px;
}

/* Send Button Container */
.send-button-container {
    margin-top: 24px;
    padding-bottom: 20px;
}

.home-screen .form-group {
    margin-bottom: 20px;
}

.home-textarea {
    min-height: 140px;
    font-size: 1rem;
    line-height: 1.7;
}

/* Form Row - Side by Side */
.form-row {
    display: flex;
    gap: 16px;
}

.form-group-half {
    flex: 1;
}

/* Form Label Row */
.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.form-label-row .form-label {
    margin-bottom: 0;
}

.tag-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Fixed Bottom Button */
.fixed-bottom-button {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px 24px;
    background: linear-gradient(to top, var(--background-cream) 70%, transparent);
    z-index: 90;
}

.fixed-bottom-button .btn-send,
.send-button-container .btn-send {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-icon-left {
    font-size: 1.1rem;
}

/* Mood Tags - Home Style */
.home-screen .mood-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-screen .mood-tag {
    padding: 8px 14px;
    border-radius: 24px;
    font-size: 0.85rem;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    transition: all 0.2s ease;
}

.home-screen .mood-tag:hover {
    border-color: var(--tag-color, var(--primary-color));
    background: rgba(255, 140, 90, 0.05);
}

.home-screen .mood-tag.selected {
    background: var(--tag-color, var(--primary-color));
    color: white;
    border-color: var(--tag-color, var(--primary-color));
}

@media (min-width: 768px) {
    .fixed-bottom-button {
        padding: 16px 48px;
    }
}

@media (min-width: 1024px) {
    .fixed-bottom-button {
        padding: 16px 60px;
    }

    .fixed-bottom-button .btn-send {
        max-width: 1000px;
    }
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .fixed-bottom-button {
        padding: 12px 16px 20px;
        bottom: 0;
    }
}

/* ==================== */
/* Authentication Screens */
/* ==================== */

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, var(--background-cream) 0%, var(--background-warm) 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 32px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-form-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 24px;
}

/* Input with icon */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .form-input {
    padding-left: 44px;
    padding-right: 44px;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    pointer-events: none;
    opacity: 0.6;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.password-toggle:hover {
    opacity: 1;
}

.password-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 6px;
}

.auth-forgot-password {
    text-align: right;
    margin-bottom: 20px;
}

.auth-forgot-password a {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
}

.auth-forgot-password a:hover {
    text-decoration: underline;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

.auth-divider span {
    padding: 0 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Social Login Buttons */
.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
}

.btn-social:hover {
    background: var(--background-cream);
    border-color: var(--primary-light);
}

.btn-google {
    border-color: var(--card-border);
}

.google-icon {
    flex-shrink: 0;
}

/* Auth Link */
.auth-link {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

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

/* Forgot Password Modal */
.forgot-password-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Loading State for Auth Buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Responsive Auth */
@media (max-width: 480px) {
    .auth-container {
        padding: 24px 20px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        max-width: 100%;
    }

    .auth-screen {
        padding: 0;
        align-items: flex-start;
    }

    .auth-title {
        font-size: 1.8rem;
    }
}

/* ==================== */
/* Mobile Optimizations */
/* ==================== */
@media (max-width: 480px) {
    /* Modal buttons - prevent text wrapping */
    .modal-actions {
        flex-direction: row;
        gap: 8px;
    }

    .modal-actions .btn {
        padding: 12px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
        min-width: 0;
        flex: 1;
    }

    /* Modal content padding */
    .modal-content {
        padding: 24px 16px;
        width: 95%;
    }

    /* Navigation - compact for mobile */
    .header-nav .nav-item {
        padding: 6px 10px;
        gap: 2px;
    }

    .header-nav .nav-label {
        font-size: 0.65rem;
        white-space: nowrap;
    }

    .header-nav .nav-icon {
        font-size: 1.1rem;
    }

    /* Header compact */
    .app-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .app-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }

    .header-nav {
        padding: 6px;
        gap: 4px;
    }
}

/* ==================== */
/* PWA Install Banner */
/* ==================== */
.install-banner {
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    z-index: 500;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    border-radius: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-banner-text {
    font-size: 0.9rem;
    flex: 1;
    line-height: 1.4;
}

.install-banner .btn-small {
    padding: 10px 20px;
    font-size: 0.9rem;
    white-space: nowrap;
    background: white;
    color: #667eea;
    font-weight: 600;
    border-radius: 20px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.install-banner .btn-small:hover {
    background: #f0f0f0;
    transform: scale(1.02);
}

.install-banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.install-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== */
/* Pending Banner */
/* ==================== */
.pending-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #e8f4ea 0%, #d4e8d7 100%);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.pending-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.pending-banner-content {
    flex: 1;
}

.pending-banner-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pending-banner-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pending-banner-refresh {
    background: white;
    border: 1px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.pending-banner-refresh:hover {
    transform: rotate(180deg);
}

.pending-banner-refresh.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==================== */
/* Send Success Modal */
/* ==================== */
.send-success-body {
    text-align: center;
    padding: 20px 0;
}

.send-success-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.send-success-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.send-success-info {
    background: var(--background);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
}

.send-success-info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.send-success-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ==================== */
/* History Screen Enhanced */
/* ==================== */
.history-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.history-stat {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.history-stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.history-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sort-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==================== */
/* Offline Banner */
/* ==================== */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff6b6b;
    color: white;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 600;
    font-size: 0.9rem;
}

.offline-banner-icon {
    font-size: 1rem;
}

body.offline .app-header {
    top: 36px;
}

body.offline .main-content {
    padding-top: 116px;
}

body.offline .btn-primary:not(.btn-small) {
    opacity: 0.6;
    pointer-events: none;
}

body.offline .send-quote-btn {
    opacity: 0.6;
    pointer-events: none;
}
