/**
 * ConvMaster - Timestamp Converter Styles
 * 
 * @package    ConvMaster
 * @version    1.0.0
 */

/* ==========================================================================
   Tool Page Layout
   ========================================================================== */

.tool-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ==========================================================================
   Tool Header
   ========================================================================== */

.tool-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.tool-header__icon {
    flex-shrink: 0;
}

.tool-header__icon .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    font-size: 2rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.tool-header__icon .icon--purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.tool-header__text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin: 0 0 0.25rem 0;
}

.tool-header__text p {
    font-size: 1rem;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

/* ==========================================================================
   Timestamp Widget - Current Timestamp Display
   ========================================================================== */

.timestamp-widget {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.current-timestamp {
    margin-bottom: 1.5rem;
}

.current-timestamp__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.current-timestamp__value {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 3rem;
    font-weight: 700;
    color: #8b5cf6;
    letter-spacing: 0.02em;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.current-timestamp__value.updating {
    transform: scale(1.02);
}

.current-timestamp__actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.current-date {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.current-date__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.current-date__value {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary, #1f2937);
}

/* ==========================================================================
   Converter Panels
   ========================================================================== */

.converter-panels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.converter-panel {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.converter-panel__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--card-header-bg, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.converter-panel__icon {
    font-size: 1.5rem;
}

.converter-panel__header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin: 0;
}

.converter-panel__body {
    padding: 1.5rem;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1f2937);
    margin-bottom: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary, #1f2937);
    background: var(--input-bg, #ffffff);
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-input::placeholder {
    color: var(--text-tertiary, #9ca3af);
}

.input-with-btn {
    display: flex;
    gap: 0.5rem;
}

.input-with-btn .form-input {
    flex: 1;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary, #1f2937);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color, #d1d5db);
    border-radius: 4px;
    background: var(--input-bg, #ffffff);
    transition: all 0.2s ease;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn--primary {
    color: white;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn--primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

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

.btn--outline {
    color: var(--text-primary, #374151);
    background: var(--input-bg, #ffffff);
    border: 1px solid var(--border-color, #d1d5db);
}

.btn--outline:hover {
    background: var(--hover-bg, #f3f4f6);
    border-color: var(--border-hover, #9ca3af);
}

.btn--ghost {
    color: var(--text-secondary, #6b7280);
    background: transparent;
}

.btn--ghost:hover {
    color: var(--text-primary, #374151);
    background: var(--hover-bg, #f3f4f6);
}

.btn--sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

.btn--block {
    width: 100%;
}

.btn--icon {
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 1.125rem;
    color: var(--text-secondary, #6b7280);
    background: var(--input-bg, #ffffff);
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
}

.btn--icon:hover {
    color: #8b5cf6;
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.btn__icon {
    font-size: 1.125em;
}

.btn--copy {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.btn--copy:hover {
    opacity: 1;
    background: var(--hover-bg, #f3f4f6);
}

/* ==========================================================================
   Conversion Results
   ========================================================================== */

.conversion-result {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.result-formats {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.result-format {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.result-format__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.result-format__value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-primary, #1f2937);
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    word-break: break-all;
}

.result-format--large .result-format__value {
    font-size: 1.25rem;
    font-weight: 600;
}

.result-timestamp {
    color: #8b5cf6;
}

.conversion-error {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

/* ==========================================================================
   History Section
   ========================================================================== */

.history-section {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.history-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--hover-bg, #f9fafb);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: var(--active-bg, #f3f4f6);
}

.history-item__ts {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    color: #8b5cf6;
    font-weight: 500;
}

.history-item__arrow {
    color: var(--text-tertiary, #9ca3af);
    margin: 0 0.75rem;
}

.history-item__date {
    color: var(--text-primary, #1f2937);
    flex: 1;
}

.history-item__action {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.history-item__action:hover {
    opacity: 1;
}

/* ==========================================================================
   Info Notice
   ========================================================================== */

.timestamp-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--info-bg, #f0f9ff);
    border: 1px solid var(--info-border, #bae6fd);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.timestamp-info span {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.timestamp-info p {
    font-size: 0.875rem;
    color: var(--info-text, #0369a1);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   SEO Content
   ========================================================================== */

.tool-content {
    margin-top: 3rem;
}

.tool-section {
    margin-bottom: 2.5rem;
}

.tool-section h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin: 0 0 1rem 0;
}

.tool-section > p {
    font-size: 1rem;
    color: var(--text-secondary, #4b5563);
    line-height: 1.7;
    margin: 0;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.feature-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.feature-card__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin: 0 0 0.5rem 0;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
    margin: 0;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.step-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.step-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 50%;
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin: 0 0 0.5rem 0;
}

.step-card p {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
    margin: 0;
}

/* FAQ List */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-secondary, #6b7280);
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    padding: 0 1.25rem 1rem;
    font-size: 0.9375rem;
    color: var(--text-secondary, #4b5563);
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   Hidden State
   ========================================================================== */

[hidden] {
    display: none !important;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.875rem 1.5rem;
    background: #1f2937;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Dark Theme
   ========================================================================== */

[data-theme="dark"] .tool-header__text h1,
.dark .tool-header__text h1 {
    color: #f9fafb;
}

[data-theme="dark"] .tool-header__text p,
.dark .tool-header__text p {
    color: #9ca3af;
}

[data-theme="dark"] .timestamp-widget,
.dark .timestamp-widget,
[data-theme="dark"] .converter-panel,
.dark .converter-panel,
[data-theme="dark"] .history-section,
.dark .history-section,
[data-theme="dark"] .feature-card,
.dark .feature-card,
[data-theme="dark"] .step-card,
.dark .step-card,
[data-theme="dark"] .faq-item,
.dark .faq-item {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .converter-panel__header,
.dark .converter-panel__header {
    background: #111827;
    border-color: #374151;
}

[data-theme="dark"] .converter-panel__header h2,
.dark .converter-panel__header h2,
[data-theme="dark"] .history-header h3,
.dark .history-header h3,
[data-theme="dark"] .feature-card h3,
.dark .feature-card h3,
[data-theme="dark"] .step-card h3,
.dark .step-card h3,
[data-theme="dark"] .faq-item summary,
.dark .faq-item summary,
[data-theme="dark"] .tool-section h2,
.dark .tool-section h2 {
    color: #f9fafb;
}

[data-theme="dark"] .current-timestamp__label,
.dark .current-timestamp__label,
[data-theme="dark"] .current-date__label,
.dark .current-date__label,
[data-theme="dark"] .result-format__label,
.dark .result-format__label {
    color: #9ca3af;
}

[data-theme="dark"] .current-date__value,
.dark .current-date__value,
[data-theme="dark"] .result-format__value,
.dark .result-format__value,
[data-theme="dark"] .history-item__date,
.dark .history-item__date {
    color: #e5e7eb;
}

[data-theme="dark"] .form-input,
.dark .form-input,
[data-theme="dark"] .checkbox-custom,
.dark .checkbox-custom {
    background: #111827;
    border-color: #4b5563;
    color: #f9fafb;
}

[data-theme="dark"] .form-input:focus,
.dark .form-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .form-group label,
.dark .form-group label,
[data-theme="dark"] .checkbox-label,
.dark .checkbox-label {
    color: #e5e7eb;
}

[data-theme="dark"] .btn--outline,
.dark .btn--outline,
[data-theme="dark"] .btn--icon,
.dark .btn--icon {
    background: #111827;
    border-color: #4b5563;
    color: #e5e7eb;
}

[data-theme="dark"] .btn--outline:hover,
.dark .btn--outline:hover,
[data-theme="dark"] .btn--icon:hover,
.dark .btn--icon:hover {
    background: #1f2937;
    border-color: #6b7280;
}

[data-theme="dark"] .btn--ghost,
.dark .btn--ghost {
    color: #9ca3af;
}

[data-theme="dark"] .btn--ghost:hover,
.dark .btn--ghost:hover {
    color: #e5e7eb;
    background: #374151;
}

[data-theme="dark"] .conversion-result,
.dark .conversion-result,
[data-theme="dark"] .current-date,
.dark .current-date {
    border-color: #374151;
}

[data-theme="dark"] .conversion-error,
.dark .conversion-error {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .history-item,
.dark .history-item {
    background: #111827;
}

[data-theme="dark"] .history-item:hover,
.dark .history-item:hover {
    background: #1f2937;
}

[data-theme="dark"] .timestamp-info,
.dark .timestamp-info {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .timestamp-info p,
.dark .timestamp-info p {
    color: #c4b5fd;
}

[data-theme="dark"] .tool-section > p,
.dark .tool-section > p,
[data-theme="dark"] .feature-card p,
.dark .feature-card p,
[data-theme="dark"] .step-card p,
.dark .step-card p,
[data-theme="dark"] .faq-item p,
.dark .faq-item p {
    color: #9ca3af;
}

[data-theme="dark"] .feature-card:hover,
.dark .feature-card:hover {
    border-color: #7c3aed;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .tool-page {
        padding: 1.5rem 1rem;
    }

    .tool-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .tool-header__icon .icon {
        width: 56px;
        height: 56px;
        font-size: 1.75rem;
    }

    .tool-header__text h1 {
        font-size: 1.5rem;
    }

    .current-timestamp__value {
        font-size: 2rem;
    }

    .current-timestamp__actions {
        flex-wrap: wrap;
    }

    .converter-panels {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

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

    .history-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .history-item__arrow {
        display: none;
    }

    .history-item__date {
        width: 100%;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .current-timestamp__value {
        font-size: 1.5rem;
    }

    .converter-panel__body {
        padding: 1rem;
    }

    .input-with-btn {
        flex-wrap: wrap;
    }

    .input-with-btn .form-input {
        width: 100%;
    }

    .input-with-btn .btn--icon {
        flex: 1;
    }
}
