/* ===============================================
   TIME CALCULATOR - USING MODERNTOOLS UNIFIED THEME
   =============================================== */

/* Use modern tools color scheme */
:root {
    --primary-color: #3B82F6;
    --secondary-color: #10B981;
    --accent-color: #8B5CF6;
    --text-color: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-base: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;    
    --radius-2xl: 1.5rem;
    
    /* Gray color scale for consistency */
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    
    /* Additional colors for time calculator functionality */
    --danger-color: #EF4444;
    --danger-light: #FCA5A5;
    --success-color: #10B981;
    --success-light: #A7F3D0;
    --warning-color: #F59E0B;
    --warning-light: #FDE68A;
    
    /* Aliases for compatibility with existing time calculator code */
    --brand-primary: var(--primary-color);
    --brand-secondary: var(--secondary-color);
    --text-primary: var(--text-color);
}

/* Dark theme using exact same colors as percentage calculator */
[data-theme="dark"] {
    --text-color: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    
    /* Dark theme specific colors */
    --gray-100: #374151;
    --gray-200: #4B5563;
    --gray-300: #6B7280;
    --gray-400: #9CA3AF;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-color);
    line-height: 1.6;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===============================================
   HERO SECTION STYLES
   =============================================== */

.tool-hero {
    margin-top: 0;
    padding: 120px 0 80px;
    position: relative;
    z-index: 2;
    background:  linear-gradient(135deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.1) 30%, rgba(16, 185, 129, 0.1) 70%, var(--bg-primary) 100%);
    overflow: hidden;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    border-radius: 50%;
    box-shadow: 
        0 15px 35px rgba(59, 130, 246, 0.4),
        0 0 0 10px rgba(59, 130, 246, 0.1),
        0 0 0 20px rgba(59, 130, 246, 0.05);
    /* animation: heroIconFloat 4s ease-in-out infinite; */
    position: relative;
    overflow: hidden;
}


.hero-icon i {
    font-size: 3rem;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0 0 20px 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--text-color) 0%, var(--primary-color) 50%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: heroTitleShine 4s ease-in-out infinite;
}

@keyframes heroTitleShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-content p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    animation: heroDescriptionFade 3s ease-in-out infinite;
}

@keyframes heroDescriptionFade {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

@keyframes heroTimeParticles {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-30px) rotate(360deg); }
}

/* Responsive hero adjustments */
@media (max-width: 768px) {    
    .hero-icon {
        width: 80px;
        height: 80px;
        margin: 0 auto 25px auto;
    }
    
    .hero-icon i {
        font-size: 2.5rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {    
    .hero-icon {
        width: 70px;
        height: 70px;
        margin: 0 auto 20px auto;
    }
    
    .hero-icon i {
        font-size: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
}

/* Calculator Main Section */
.calculator-main {
    padding: 4rem 0;
    position: relative;
}

.calculator-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

/* Mode Toggle */
.calculator-mode-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.toggle-label {
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.toggle-label.active {
    color: var(--text-color);
    font-weight: 600;
}

.mode-toggle {
    position: relative;
    width: 48px;
    height: 24px;
    background: var(--gray-200);
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mode-toggle.active {
    background: var(--primary-color);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.mode-toggle.active .toggle-slider {
    transform: translateX(24px);
}

/* Calculator Tabs */
.calculator-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-button {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-base);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.875rem;
}

.tab-button:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Calculator Card */
.calculator-card {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Display Area */
.calculator-display {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.calculator-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.display-result {
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: block;
}

.result-unit {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 500;
    margin-left: 0.5rem;
}

.display-formula {
    font-size: 1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Input Sections */
.calculator-inputs {
    padding: 2rem;
}

.input-section {
    display: none;
}

.input-section.active {
    display: block;
}

.basic-inputs,
.advanced-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.advanced-inputs {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Time Input Groups */
.time-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.time-input-group label,
.datetime-input-group label,
.input-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.time-input {
    width: 80px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    background: var(--bg-primary);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.time-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.time-inputs span {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1.25rem;
}

/* DateTime Inputs */
.datetime-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.datetime-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.date-input,
.time-input-full {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.date-input:focus,
.time-input-full:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-group input,
.input-group select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Operation Selector */
.operation-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.operation-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.operation-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.operation-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Format Buttons */
.format-options,
.result-format-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.format-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.format-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.format-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.format-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Timezone Selectors */
.timezone-selectors {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.timezone-selectors .input-group {
    flex: 1;
    min-width: 200px;
}

.timezone-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5rem 1.5rem;
    padding-right: 2.5rem;
}

/* Workday Options */
.workday-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Countdown Display */
.countdown-display {
    margin: 1.5rem 0;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-base);
    min-width: 80px;
}

.countdown-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.countdown-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Countdown Controls */
.countdown-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.countdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.countdown-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Action Buttons */
.calculator-actions {
    display: flex;
    gap: 1rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-base);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
}

.action-button.primary {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.action-button.primary:hover {
    background: #2563EB;
    border-color: #2563EB;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.action-button.secondary {
    background: var(--bg-primary);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.action-button.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

/* Results History */
.results-history {
    margin-top: 2rem;
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.results-history h3 {
    padding: 1.5rem 2rem;
    background: var(--bg-tertiary);
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-item:last-child {
    border-bottom: none;
}

.history-calculation {
    font-weight: 500;
    color: var(--text-color);
}

.history-result {
    font-weight: 600;
    color: var(--primary-color);
}

.clear-history-btn {
    width: 100%;
    padding: 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.clear-history-btn:hover {
    background: #DC2626;
}

/* Timeline Section */
.timeline-section {
    padding: 4rem 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.timeline-container {
    max-width: 900px;
    margin: 0 auto;
}

.timeline-container h3 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.timeline-chart {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    border: 1px solid var(--border-color);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.125rem;
    }

    .calculator-tabs {
        gap: 0.25rem;
        padding: 0.25rem;
    }

    .tab-button {
        min-width: 100px;
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
    }

    .calculator-inputs {
        padding: 1.5rem;
    }

    .datetime-container,
    .timezone-selectors {
        flex-direction: column;
    }

    .time-inputs {
        justify-content: center;
    }

    .countdown-timer {
        gap: 1rem;
    }

    .countdown-unit {
        min-width: 70px;
        padding: 0.75rem;
    }

    .countdown-value {
        font-size: 1.5rem;
    }

    .calculator-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .action-button {
        min-width: auto;
    }

    .operation-selector {
        flex-direction: column;
        gap: 0.75rem;
    }

    .format-buttons {
        justify-content: center;
    }

    .result-value {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .toggle-container {
        padding: 0.5rem 1rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .calculator-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .calculator-tabs::-webkit-scrollbar {
        display: none;
    }

    .time-input {
        width: 70px;
        padding: 0.625rem;
    }

    .countdown-timer {
        gap: 0.75rem;
    }

    .countdown-unit {
        min-width: 60px;
        padding: 0.5rem;
    }

    .countdown-value {
        font-size: 1.25rem;
    }

    .countdown-label {
        font-size: 0.75rem;
    }
}

/* Animation for smooth transitions */
.input-section,
.advanced-inputs {
    transition: all 0.3s ease;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error states */
.success {
    border-color: var(--success-color) !important;
    background-color: rgba(16, 185, 129, 0.05);
}

.error {
    border-color: var(--danger-color) !important;
    background-color: rgba(239, 68, 68, 0.05);
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}
