@charset "UTF-8";

/* Add smooth scrolling to the html element */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--font-color);
    padding-top: 40px;
}

.main-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0px 20px 20px 20px;
}

.tool-header {
    text-align: center;
    margin-bottom: 20px;
}

.tool-title {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--font-color);
    margin-bottom: 10px;
}

.tool-subtitle {
    font-size: 1.2em;
    color: var(--font-color);
    opacity: 0.8;
    margin: 0;
}

.tool-content {
    background: var(--content-bg-color);
    border-radius: 15px;
    padding: 10px 30px 30px 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* Current Time Section */
.current-time-section {
    margin-bottom: 40px;
}

.current-time-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: var(--font-color);
    text-align: center;
}

.current-time-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.time-card {
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid #ddd;
    position: relative;
}

.time-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--font-color);
    margin-bottom: 10px;
    opacity: 0.8;
}

.time-value {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: var(--font-color);
    margin-bottom: 15px;
    word-break: break-all;
    line-height: 1.4;
}

.copy-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

/* Conversion Section */
.conversion-section {
    margin-bottom: 40px;
}

.conversion-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: var(--font-color);
}

.converter-input {
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #ddd;
}

.input-group {
    margin-bottom: 20px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--font-color);
}

.input-group select,
.input-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: var(--content-bg-color, #fff);
    color: var(--font-color);
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

/* Input with button container */
.input-with-button {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-with-button input[type="text"] {
    flex: 1;
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.clear-input-btn {
    background: #dc3545;
    color: white;
    border: 2px solid #ddd;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    font-size: 16px;
    font-weight: bold;
}

.clear-input-btn:hover {
    background: #c82333;
    transform: none;
}

.clear-input-btn:active {
    background: #bd2130;
}

.input-group select:focus,
.input-group input[type="text"]:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Focus state for input with button */
.input-with-button input[type="text"]:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    z-index: 1;
    position: relative;
}

.input-with-button input[type="text"]:focus + .clear-input-btn {
    border-color: #4CAF50;
}

.input-group small {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--font-color);
    opacity: 0.7;
}

.conversion-results {
    min-height: 100px;
}

.conversion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.conversion-card {
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 10px;
    padding: 18px;
    border: 2px solid #ddd;
    text-align: center;
}

.conversion-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--font-color);
    margin-bottom: 8px;
    opacity: 0.8;
}

.conversion-value {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    color: var(--font-color);
    margin-bottom: 12px;
    word-break: break-all;
    line-height: 1.4;
    min-height: 20px;
}

.placeholder-message {
    text-align: center;
    color: var(--font-color);
    opacity: 0.6;
    padding: 40px 20px;
    font-style: italic;
}

.error-message {
    background: #dc3545;
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

/* Quick Tools Inline (compact version) */
.quick-tools-inline {
    margin-top: 15px;
    margin-bottom: 5px;
}

.quick-tools-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--font-color);
    font-size: 14px;
}

.quick-tools-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.quick-tool-compact-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    min-height: 32px;
}

.quick-tool-compact-btn:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

.quick-tool-compact-btn:active:not(:disabled) {
    transform: translateY(0);
}

.quick-tool-compact-btn:disabled,
.quick-tool-compact-btn.disabled {
    background: #6c757d !important;
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Button Divider */
.button-divider {
    width: 2px;
    height: 28px;
    background: #ddd;
    margin: 0 4px;
    border-radius: 1px;
    flex-shrink: 0;
}

body.dark-mode .button-divider {
    background: #555;
}

/* Color variations for NOW buttons */
.quick-tool-compact-btn.now-btn:nth-child(1):not(:disabled) { /* Now Unix */
    background: #28a745;
}
.quick-tool-compact-btn.now-btn:nth-child(1):hover:not(:disabled) {
    background: #218838;
}

.quick-tool-compact-btn.now-btn:nth-child(2):not(:disabled) { /* Now ISO */
    background: #17a2b8;
}
.quick-tool-compact-btn.now-btn:nth-child(2):hover:not(:disabled) {
    background: #138496;
}

/* Color variations for MATH buttons */
.quick-tool-compact-btn.math-btn:nth-child(4):not(:disabled), /* +1 Week */
.quick-tool-compact-btn.math-btn:nth-child(6):not(:disabled) { /* +1 Day */
    background: #007bff;
}
.quick-tool-compact-btn.math-btn:nth-child(4):hover:not(:disabled),
.quick-tool-compact-btn.math-btn:nth-child(6):hover:not(:disabled) {
    background: #0056b3;
}

.quick-tool-compact-btn.math-btn:nth-child(5):not(:disabled), /* -1 Week */
.quick-tool-compact-btn.math-btn:nth-child(7):not(:disabled) { /* -1 Day */
    background: #dc3545;
}
.quick-tool-compact-btn.math-btn:nth-child(5):hover:not(:disabled),
.quick-tool-compact-btn.math-btn:nth-child(7):hover:not(:disabled) {
    background: #c82333;
}

.quick-tool-compact-btn.math-btn:nth-child(8):not(:disabled), /* +1 Hour */
.quick-tool-compact-btn.math-btn:nth-child(10):not(:disabled) { /* +15 Min */
    background: #fd7e14;
}
.quick-tool-compact-btn.math-btn:nth-child(8):hover:not(:disabled),
.quick-tool-compact-btn.math-btn:nth-child(10):hover:not(:disabled) {
    background: #e8630e;
}

.quick-tool-compact-btn.math-btn:nth-child(9):not(:disabled), /* -1 Hour */
.quick-tool-compact-btn.math-btn:nth-child(11):not(:disabled) { /* -15 Min */
    background: #6f42c1;
}
.quick-tool-compact-btn.math-btn:nth-child(9):hover:not(:disabled),
.quick-tool-compact-btn.math-btn:nth-child(11):hover:not(:disabled) {
    background: #5a32a3;
}

/* Examples Section */
.examples-section {
    margin-bottom: 40px;
}

.examples-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: var(--font-color);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.example-card {
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-card:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.example-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--font-color);
    margin-bottom: 8px;
}

.example-value {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--font-color);
    margin-bottom: 8px;
    word-break: break-all;
    background: var(--content-bg-color, #fff);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.example-desc {
    font-size: 12px;
    color: var(--font-color);
    opacity: 0.7;
}

/* Information Section */
.info-section {
    margin-bottom: 20px;
}

.info-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: var(--font-color);
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.info-item {
    background: var(--alt-content-bg-color, #f8f9fa);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #ddd;
}

.info-item h4 {
    font-size: 16px;
    margin: 0 0 10px 0;
    color: var(--font-color);
}

.info-item p {
    font-size: 14px;
    margin: 0;
    color: var(--font-color);
    opacity: 0.8;
    line-height: 1.5;
}

/* Dark Mode Adaptations */
body.dark-mode .tool-content {
    background: var(--content-bg-color);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

body.dark-mode .time-card,
body.dark-mode .conversion-card,
body.dark-mode .example-card,
body.dark-mode .info-item,
body.dark-mode .converter-input {
    background: var(--alt-content-bg-color, #2d2d2d);
    border-color: #555;
}

body.dark-mode .input-group select,
body.dark-mode .input-group input[type="text"] {
    background: var(--content-bg-color);
    border-color: #555;
}

body.dark-mode .clear-input-btn {
    background: #dc3545;
    border-color: #555;
}

body.dark-mode .clear-input-btn:hover {
    background: #c82333;
}

body.dark-mode .input-with-button input[type="text"]:focus + .clear-input-btn {
    border-color: #4CAF50;
}

body.dark-mode .example-value {
    background: var(--content-bg-color);
    border-color: #555;
}

body.dark-mode .quick-tool-compact-btn {
    border: 1px solid #555;
}

body.dark-mode .quick-tools-label {
    color: var(--font-color);
}

body.dark-mode .quick-tool-compact-btn:disabled,
body.dark-mode .quick-tool-compact-btn.disabled {
    background: #6c757d !important;
    opacity: 0.3;
    border-color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        padding: 15px;
    }
    
    .tool-content {
        padding: 20px;
    }
    
    .tool-title {
        font-size: 2em;
    }
    
    .current-time-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    
    .quick-tools-compact {
        justify-content: center;
    }
    
    .quick-tool-compact-btn {
        flex: 1;
        min-width: 80px;
        max-width: 120px;
        justify-content: center;
    }
    
    .button-divider {
        display: none; /* Hide divider on smaller screens */
    }
    
    .conversion-grid,
    .examples-grid,
    .info-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-content {
        padding: 15px;
    }
    
    .converter-input {
        padding: 15px;
    }
    
    .current-time-grid {
        max-width: 100%;
    }
    
    .quick-tools-compact {
        grid-template-columns: repeat(2, 1fr);
        display: grid;
        gap: 6px;
    }
    
    .quick-tool-compact-btn {
        font-size: 11px;
        padding: 8px 6px;
        flex-direction: column;
        gap: 2px;
        min-height: 40px;
    }
    
    .quick-tool-compact-btn .tool-text {
        font-size: 10px;
    }
    
    .button-divider {
        display: none; /* Hide divider on mobile */
    }
    
    .time-card,
    .conversion-card,
    .example-card,
    .info-item {
        padding: 15px;
    }
}