/* ===========================
   Sleep Cycle Calculator CSS
   Modern, Clean, Minimalist Design
   =========================== */

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    font-size: 15px;
}

/* Dark Mode - Fixed colors */
body.dark-mode {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #f1f5f9;
}

body.dark-mode .main-container,
body.dark-mode .calculator-section,
body.dark-mode .youtube-section,
body.dark-mode .weather-section,
body.dark-mode .products-section,
body.dark-mode .social-section,
body.dark-mode .content-section {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
}

body.dark-mode .header-section,
body.dark-mode .footer-section {
    background: #1e293b;
    color: #f1f5f9;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

body.dark-mode .form-control::placeholder {
    color: #64748b;
}

body.dark-mode .results-section {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .time-card {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border-color: #475569;
}

body.dark-mode .time-value {
    color: #a5b4fc;
}

body.dark-mode .time-label {
    color: #94a3b8;
}

body.dark-mode .section-title {
    color: #a5b4fc;
}

body.dark-mode .btn-outline-primary {
    border-color: #6366f1;
    color: #a5b4fc;
}

body.dark-mode .btn-outline-primary:hover {
    background: #6366f1;
    color: white;
}

body.dark-mode .nav-tabs .nav-link {
    color: #94a3b8;
    border-color: #334155;
}

body.dark-mode .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

body.dark-mode .weather-content,
body.dark-mode .product-card,
body.dark-mode .playlist-queue {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .product-title,
body.dark-mode .form-label {
    color: #f1f5f9;
}

body.dark-mode .product-price {
    color: #a5b4fc;
}

body.dark-mode .weather-description {
    color: #94a3b8;
}

body.dark-mode .content-section h2 {
    color: #a5b4fc;
}

body.dark-mode .content-section p {
    color: #cbd5e1;
}

/* Header - Cleaner Design */
.header-section {
    background: white;
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.02em;
}

.site-title i {
    -webkit-text-fill-color: var(--primary-color);
}

/* Main Container - Cleaner Boxed Layout */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
}

/* Current Time Display - Minimalist */
.current-time-section {
    text-align: center;
    margin-bottom: 32px;
}

.current-time-section h2 {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.time-display {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* Section Styling - Cleaner */
.calculator-section,
.youtube-section,
.weather-section,
.products-section,
.social-section,
.content-section {
    margin-bottom: 32px;
    padding: 28px;
    background: var(--light-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.section-title i {
    font-size: 1.3rem;
}

/* Two Column Layout for Calculator and YouTube */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 992px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

/* Calculator Tabs - Modern */
.nav-tabs {
    border: none;
    gap: 8px;
    margin-bottom: 24px;
}

.nav-tabs .nav-link {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dark);
    font-weight: 600;
    padding: 10px 20px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav-tabs .nav-link:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Form Controls - Clean */
.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Buttons - Modern */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-outline-primary {
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    padding: 8px 18px;
    font-weight: 600;
    transition: all 0.2s ease;
    background: transparent;
    font-size: 0.9rem;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.btn-dark {
    background: var(--text-dark);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-dark:hover {
    background: var(--text-light);
    transform: translateY(-1px);
}

/* Results Section - Clean */
.results-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.results-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 1.2rem;
}

.time-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 12px;
    border: 1.5px solid rgba(99, 102, 241, 0.15);
    transition: all 0.2s ease;
    cursor: pointer;
}

.time-card:hover {
    transform: translateX(4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.time-card.recommended {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: transparent;
}

.time-card.recommended .time-value,
.time-card.recommended .time-label {
    color: white;
}

.time-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.01em;
}

.time-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.badge-recommended {
    background: var(--success-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-left: 8px;
}

/* YouTube Section - Clean */
.youtube-input-group {
    display: flex;
    gap: 8px;
}

.youtube-input-group .form-control {
    flex: 1;
}

.youtube-player-wrapper {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    aspect-ratio: 16/9;
}

#youtubePlayer {
    width: 100%;
    height: 100%;
}

.youtube-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.youtube-controls .btn {
    flex: 1;
    min-width: 90px;
}

.playlist-queue {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 16px;
    border: 1px solid var(--border-color);
}

.playlist-queue h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.playlist-queue .list-group-item {
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.playlist-queue .list-group-item:hover {
    background: var(--light-bg);
    transform: translateX(4px);
}

/* Weather Section - Clean */
.weather-content {
    background: white;
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.weather-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.weather-temp {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.weather-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.weather-alert {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    border-left: 3px solid var(--primary-color);
    text-align: left;
}

/* Products Section - Clean Grid */
.product-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    flex: 1;
    line-height: 1.5;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.product-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 8px;
    display: inline-block;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.product-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
    color: white;
}

/* Social Buttons - Clean */
.social-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-social {
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: none;
    color: white;
}

.btn-facebook {
    background: #1877f2;
}

.btn-facebook:hover {
    background: #0d65d9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.3);
}

.btn-zalo {
    background: #0068ff;
}

.btn-zalo:hover {
    background: #0052cc;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 104, 255, 0.3);
}

.btn-share {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

/* Content Section - Clean Typography */
.content-section article {
    background: white;
    border-radius: 12px;
    padding: 28px;
    border: 1px solid var(--border-color);
}

.content-section h2 {
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 28px;
    margin-bottom: 14px;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-dark);
    margin-bottom: 20px;
}

/* Footer - Clean */
.footer-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-top: 32px;
    box-shadow: var(--shadow);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.footer-section p {
    margin: 5px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Modal - Clean */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-hover);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 16px 16px 0 0;
    padding: 20px 24px;
}

.modal-title {
    font-weight: 700;
    font-size: 1.2rem;
}

.modal-body {
    padding: 24px;
}

/* Order Form Styles */
.order-product-info {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.order-product-info img {
    object-fit: cover;
}

.order-product-info h6 {
    font-weight: 600;
    margin-top: 8px;
}

/* Dark mode order form */
body.dark-mode .order-product-info {
    background: #0f172a;
}

/* Table Styles for Admin Orders */
.table {
    font-size: 0.9rem;
}

.table th {
    background: var(--light-bg);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.btn-group-sm .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 12px;
        font-size: 14px;
    }
    
    .main-container {
        padding: 20px;
    }
    
    .header-section {
        padding: 16px 20px;
    }
    
    .site-title {
        font-size: 1.4rem;
    }
    
    .time-display {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .quote-text {
        font-size: 1rem;
    }
    
    .calculator-section,
    .youtube-section,
    .weather-section,
    .products-section,
    .social-section,
    .content-section {
        padding: 20px;
    }
    
    .youtube-controls .btn {
        min-width: auto;
        flex: 1 1 calc(50% - 4px);
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .social-buttons {
        flex-direction: column;
    }
    
    .btn-social {
        width: 100%;
    }
    
    .nav-tabs .nav-link {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

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

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

/* Loading Spinner */
.spinner-border {
    width: 2.5rem;
    height: 2.5rem;
}

/* Advanced Options */
.advanced-options .collapse {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    border: 1px solid var(--border-color);
}

/* Form Range Slider */
.form-range {
    height: 6px;
}

.form-range::-webkit-slider-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    width: 18px;
    height: 18px;
}

.form-range::-moz-range-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    width: 18px;
    height: 18px;
    border: none;
}

/* Accessibility */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .header-section,
    .footer-section,
    .youtube-section,
    .social-section {
        display: none;
    }
}
