/* Harmony Control - Modern UI Styles */

:root {
    --primary-color: #6f42c1;
    --primary-dark: #5a32a3;
    --primary-light: #8b5fcf;
    --secondary-color: #e83e8c;
    --secondary-dark: #d91a72;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #1a1a2e;
    --dark-lighter: #2d2d44;
    --light-color: #f8f9fa;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
}

* {
    transition: all 0.3s ease;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

main {
    flex: 1;
    padding: 2rem 0;
}

/* Navigation */
.navbar {
    background: #1a1a2e !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    border-bottom: none;
    z-index: 1030;
    margin-bottom: 0;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.navbar:first-of-type {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand i {
    -webkit-text-fill-color: #e83e8c;
    margin-right: 0.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(111, 66, 193, 0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--gradient-primary);
    color: white !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    border-bottom: none;
    font-size: 1.1rem;
}

.card-header.bg-primary {
    background: var(--gradient-primary) !important;
}

.card-header.bg-secondary {
    background: var(--gradient-secondary) !important;
}

.card-header.bg-success {
    background: var(--gradient-success) !important;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--gradient-primary);
    filter: brightness(1.1);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3494E6 0%, #EC6EAD 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #868f96 0%, #596164 100%);
    color: white;
}

/* XP Display */
.xp-display {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.level-badge {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Status Badges */
.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

.status-active {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.status-pending {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.status-paused {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

.status-ended {
    background: linear-gradient(135deg, #868f96 0%, #596164 100%);
    color: white;
}

/* Relationship Cards */
.relationship-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid var(--primary-color);
}

.relationship-card:hover {
    transform: translateX(10px) translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-left-width: 6px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.5rem 0;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #1a1a2e;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 i {
    -webkit-text-fill-color: var(--primary-color);
    margin-right: 0.5rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25);
    transform: translateY(-2px);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.2) 100%);
    border-left: 4px solid var(--success-color);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.2) 100%);
    border-left: 4px solid var(--danger-color);
    color: #721c24;
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(23, 162, 184, 0.2) 100%);
    border-left: 4px solid var(--info-color);
    color: #0c5460;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.2) 100%);
    border-left: 4px solid var(--warning-color);
    color: #856404;
}

.flash-toast-stack {
    position: fixed;
    bottom: 1.25rem;
    right: 1rem;
    z-index: 1065;
    width: min(420px, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.flash-toast {
    margin: 0;
    pointer-events: auto;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.flash-toast .btn-close {
    top: 50%;
    transform: translateY(-50%);
}

/* Task List */
.task-item {
    padding: 1.25rem;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.task-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.task-item.completed {
    border-left-color: var(--success-color);
    opacity: 0.8;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.1) 100%);
}

/* Footer */
footer {
    background: rgba(26, 26, 46, 0.95) !important;
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(111, 66, 193, 0.3);
    margin-top: auto;
}

/* Dropdown */
.dropdown-menu {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 1055 !important;
}

/* Ensure form selects and dropdowns appear above other content */
.form-select,
select.form-select {
    position: relative;
    z-index: 1000;
}

.form-select:focus,
select.form-select:focus {
    z-index: 1001;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateX(5px);
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Theme Card Styles */
.theme-card {
    transition: all 0.3s ease;
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.theme-preview {
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-radius: 16px 16px 0 0;
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 3px solid rgba(111, 66, 193, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Relationship Navigation Bar */
.relationship-nav {
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.relationship-nav.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.relationship-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.relationship-nav-btn:hover {
    background: rgba(111, 66, 193, 0.3);
    color: white;
    border-color: rgba(111, 66, 193, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(111, 66, 193, 0.3);
}

.relationship-nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: rgba(111, 66, 193, 0.8);
    box-shadow: 0 0 0 2px rgba(111, 66, 193, 0.4), 0 4px 12px rgba(111, 66, 193, 0.4);
    font-weight: 600;
}

.relationship-nav-btn i {
    margin-right: 0.3rem;
}

.relationship-nav-btn.active {
    background: rgba(111, 66, 193, 0.4) !important;
    border-color: rgba(111, 66, 193, 0.6) !important;
}

#navBarTimeout {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

#navBarTimeout option {
    background: #1a1a2e;
    color: white;
}

/* Notification Panel Styles */
.notification-toggle-btn {
    position: fixed;
    right: 20px;
    top: 120px; /* Position below nav bars (main nav ~56px + relationship nav ~48px + margin) */
    z-index: 1050;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: 3px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 255, 255, 0.5);
}

.notification-toggle-btn.has-notifications {
    background: var(--gradient-secondary);
    border-color: rgba(255, 255, 255, 0.5);
    animation: notificationPulse 2s infinite;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

@keyframes notificationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.notification-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1040;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.notification-panel.open {
    right: 0;
}

.notification-panel-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.notification-panel-footer {
    padding: 1rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(26, 26, 46, 0.95);
}

.notification-tab {
    display: none;
}

.notification-tab.active {
    display: block;
}

.section-title {
    color: #e83e8c;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(232, 62, 140, 0.3);
    font-size: 1rem;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-subsection-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notification-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    border-left: 4px solid;
    transition: all 0.3s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-5px);
}

.notification-item.info {
    border-left-color: #17a2b8;
}

.notification-item.warning {
    border-left-color: #ffc107;
}

.notification-item.danger {
    border-left-color: #dc3545;
}

.notification-item.success {
    border-left-color: #28a745;
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.notification-item-title {
    font-weight: 600;
    color: white;
    margin: 0;
    font-size: 0.95rem;
}

.notification-item-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    margin-left: 0.5rem;
}

.notification-item-body {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.5;
}

.coaching-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.coaching-tip {
    background: rgba(111, 66, 193, 0.2);
    border-radius: 10px;
    padding: 1rem;
    border-left: 4px solid #6f42c1;
    transition: all 0.3s ease;
}

.coaching-tip:hover {
    background: rgba(111, 66, 193, 0.3);
    transform: translateX(-3px);
}

.coaching-tip-title {
    font-weight: 600;
    color: #8b5fcf;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.coaching-tip-content {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Overlay when panel is open */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
}

.notification-overlay.show {
    display: block;
}

/* Store */
.store-product-card {
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}
.store-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.store-product-card:hover .store-product-img {
    transform: scale(1.05);
}
.store-product-image-wrap {
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}
.store-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.store-product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 3rem;
}
.store-product-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
}
.store-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 50%, #4a3f6b 100%);
    color: white;
}
.store-hero-badge .badge {
    font-size: 0.8rem;
    font-weight: 500;
}
@media (max-width: 768px) {
    .store-hero {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .store-hero-badge {
        margin-top: 1rem;
        text-align: left !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .notification-panel {
        width: 100%;
        right: -100%;
    }
    
    .notification-toggle-btn {
        right: 15px;
        top: 100px; /* Adjust for mobile nav height */
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .flash-toast-stack {
        bottom: 1rem;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
    }
}
