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

:root {
    /* Colors - Unique Teal/Purple Theme */
    --primary-color: #06b6d4; /* Teal */
    --primary-hover: #0891b2;
    --secondary-color: #8b5cf6; /* Purple */
    --secondary-hover: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-primary: #0f172a; /* Dark blue background */
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --accent-color: #f472b6; /* Pink accent */
    --accent-hover: #ec4899;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #475569;
    --border-light: #334155;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-md);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.header-content {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.title i {
    margin-right: var(--space-sm);
    color: var(--primary-color);
    -webkit-text-fill-color: var(--primary-color);
    animation: pulse 2s infinite;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-hover), var(--primary-color));
    transition: all 0.4s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: linear-gradient(90deg, var(--secondary-color), var(--secondary-hover));
    color: white;
    border: none;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-hover), var(--secondary-color));
    transition: all 0.4s ease;
    z-index: -1;
}

.btn-secondary:hover::before {
    left: 0;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-outline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(to top, var(--primary-color), transparent);
    opacity: 0.1;
    transition: height 0.3s ease;
    z-index: -1;
}

.btn-outline:hover::after {
    height: 100%;
}

.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Two-column Layout */
.two-column-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.column {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Input Container */
.input-container {
    padding: var(--space-lg);
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-md);
}

.timestamp-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: var(--space-md);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.timestamp-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.timestamp-input::placeholder {
    color: var(--text-muted);
}

/* Format Inputs */
.format-inputs {
    margin-top: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.format-input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-sm) 0;
    transition: all var(--transition-fast);
}

.format-input-group:hover {
    transform: translateX(var(--space-xs));
}

.format-input-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.format-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.format-input {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    width: 100%;
}

.format-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.format-input::placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Input Action Buttons */
.input-actions {
    display: none;
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    gap: var(--space-xs);
    z-index: 10;
}

.input-actions.visible {
    display: flex;
}

.input-action-btn {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
}

.input-action-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.input-action-btn.reset {
    background: var(--error-color);
    color: white;
}

.input-action-btn.reset:hover {
    background: var(--error-color);
    opacity: 0.8;
}

.input-action-btn.update {
    background: var(--primary-color);
    color: white;
}

.input-action-btn.update:hover {
    background: var(--primary-hover);
}

/* Unix Time Toggle */
.unix-time-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-sm);
    width: 100%;
}

.unix-time-container .format-input {
    width: 100%;
}

.toggle-container {
    display: flex;
    align-items: center;
    padding-right: var(--space-sm);
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    cursor: pointer;
}

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

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border-radius: 34px;
    transition: var(--transition-normal);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-primary);
    border-radius: 50%;
    transition: var(--transition-normal);
}

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

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

.toggle-label {
    position: absolute;
    right: -24px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-tools {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: var(--space-sm);
}

.tool-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.tool-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.input-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.success {
    background: var(--success-color);
}

.status-indicator.error {
    background: var(--error-color);
}

.status-indicator.warning {
    background: var(--warning-color);
}

.status-text {
    color: var(--text-muted);
}

/* Components Container */
.components-container {
    padding: var(--space-lg);
}



/* Time Components */
.time-components {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.timestamp-components::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.timestamp-components h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.component-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    font-style: italic;
}

.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.component-item {
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.component-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
    transform: translateY(-2px);
}

.component-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.component-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: var(--space-sm);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
    transition: all var(--transition-fast);
}

.component-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.component-input:hover:not(:focus) {
    border-color: var(--border-light);
}

.component-input-valid {
    border-color: var(--primary-color);
    background-color: rgba(6, 182, 212, 0.05);
}

.component-input-valid:focus {
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.3);
}

.component-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
    min-height: 1.5em;
    padding-top: var(--space-xs);
    border-top: 1px dashed var(--border-light);
    transition: all var(--transition-normal);
}

.component-value-valid {
    color: var(--primary-color);
    font-weight: 500;
}

.component-actions {
    display: flex;
    justify-content: center;
    margin-top: var(--space-lg);
}

#updateFromComponentsBtn {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: var(--space-md) var(--space-xl);
    transition: all var(--transition-normal);
}

#updateFromComponentsBtn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px -5px rgba(6, 182, 212, 0.4);
}

/* Help Section */
.help-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.help-header:hover {
    background: var(--bg-tertiary);
}

.help-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.help-arrow {
    transition: transform var(--transition-normal);
    color: var(--text-secondary);
}

.help-section.collapsed .help-arrow {
    transform: rotate(-90deg);
}

.help-content {
    padding: 0 var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--border-light);
    display: none;
}

.help-section:not(.collapsed) .help-content {
    display: block;
}

.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.help-column h5 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.help-column ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.help-column li {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.help-column li:hover {
    background: var(--bg-tertiary);
}

.help-column code {
    background: var(--bg-primary);
    color: var(--primary-color);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 120px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.example-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.example-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    text-align: center;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.example-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.example-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.example-btn:hover::after {
    left: 100%;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform var(--transition-normal);
    z-index: 1000;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: var(--space-sm);
    }

    .title {
        font-size: 2rem;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }

    .two-column-container {
        grid-template-columns: 1fr;
    }

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

    .input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .input-tools {
        margin-left: 0;
        margin-top: var(--space-sm);
        justify-content: flex-end;
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Version Footer */
.version-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    color: var(--text-muted);
    z-index: 100;
}

.version-info {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
}

.version-info span {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

@media (max-width: 768px) {
    .version-info {
        flex-direction: column;
        align-items: center;
        gap: var(--space-xs);
    }
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}


/* Time Display Styles */
.current-time {
    text-align: left;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.current-time::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
}

.time-row {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-md);
}

.time-row:last-child {
    margin-bottom: 0;
}

.time-label {
    width: 180px;
    font-weight: 600;
    color: var(--text-secondary);
}

.time-value {
    flex: 1;
    font-family: 'SF Mono', Monaco, monospace;
}

#currentTimeValue,
#currentTimestampValue {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: var(--space-sm);
}

.copy-btn:hover {
    color: var(--primary-color);
    background-color: rgba(6, 182, 212, 0.1);
}

.format-selector {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    justify-content: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.format-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

.format-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.format-btn:hover::after {
    width: 100%;
}

.format-btn.active {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    box-shadow: 0 4px 10px -2px rgba(6, 182, 212, 0.4);
}

.format-btn:hover:not(.active) {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}
