/* ==================== VOLUME CONVERTER - COMPLETE STYLES ==================== */
/* This stylesheet is specifically for the Volume Converter tool */
/* Follows the same theme as Length Converter and Temperature Converter */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ==================== CSS VARIABLES (Day/Night Support) ==================== */
:root {
    --bg: #0f0f17;
    --surface: #161622;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --primary: #10b981;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --secondary: #6366f1;
    --border: #2d2d3d;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

/* Light Mode */
.light-mode {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --primary: #10b981;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --border: #e2e8f0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Dark Mode (automatic) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f0f17;
        --surface: #161622;
        --text: #e2e8f0;
        --text-light: #94a3b8;
        --primary: #10b981;
        --primary-light: #34d399;
        --primary-dark: #059669;
        --border: #2d2d3d;
    }
}

/* ==================== BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* ==================== MAIN CONTAINER ==================== */
.agecalc-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.agecalc-wrapper {
    max-width: 950px;
    margin: 0 auto;
}

/* ==================== HEADER SECTION ==================== */
.agecalc-title {
    font-size: 2.8rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.agecalc-heart {
    font-size: 2.5rem;
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    75% { transform: scale(0.95); }
}

.agecalc-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 2rem;
    font-family: 'Poppins', sans-serif;
    line-height: 1.5;
}

/* ==================== MAIN CARD ==================== */
.agecalc-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* ==================== INPUT GROUP (3 COLUMN LAYOUT) ==================== */
.agecalc-input-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}

/* Input Cards */
.date-input-card {
    background: var(--bg);
    border-radius: 16px;
    padding: 1.2rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.date-input-card:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.date-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.required {
    color: var(--error);
}

.date-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.date-input[readonly] {
    background: var(--bg);
    cursor: default;
    opacity: 0.8;
}

/* Select Dropdown */
select.date-input {
    cursor: pointer;
    background: var(--surface);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

select.date-input option {
    background: var(--surface);
    color: var(--text);
    padding: 0.5rem;
}

/* ==================== BUTTON STYLES ==================== */
.primary-action-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.primary-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.primary-action-btn:active {
    transform: translateY(0);
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

/* Quick buttons */
.quick-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.quick-btn:active {
    transform: scale(0.95);
}

/* ==================== RESULTS SECTION ==================== */
.agecalc-results {
    background: var(--bg);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.result-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

/* Main Display */
.age-main-display {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    color: white;
    transition: all 0.3s ease;
}

.age-main-display div {
    font-size: 1.1rem;
    font-weight: 500;
    word-break: break-word;
}

/* Result Grid */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.result-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.result-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Poppins', sans-serif;
    word-break: break-word;
}

.result-label-small {
    font-size: 0.65rem;
    color: var(--text-light);
    margin-top: 0.3rem;
}

/* Additional Info Grid */
.additional-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: var(--surface);
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.info-value {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8rem;
}

/* ==================== ACTION BUTTONS CONTAINER ==================== */
.agecalc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

/* ==================== REFERENCE SECTION ==================== */
.agecalc-reference {
    margin: 1.5rem 0;
}

.agecalc-reference h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.ref-card {
    background: var(--bg);
    border-radius: 14px;
    padding: 1rem;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.ref-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.ref-card h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--primary);
}

.ref-card ul {
    padding-left: 1.2rem;
    margin: 0;
}

.ref-card li {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.ref-card strong {
    color: var(--text);
}

/* ==================== SEO CONTENT ==================== */
.agecalc-seo {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.agecalc-seo h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text);
}

.agecalc-seo h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--text);
}

.agecalc-seo h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0.8rem 0 0.3rem;
    color: var(--primary);
}

.agecalc-seo p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.feature-list {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}

.feature-list li {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

/* ==================== CONVERSION TABLE (SEO Content) ==================== */
.conversion-table {
    margin: 1rem 0;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: var(--surface);
}

.table-from {
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 500;
}

.table-arrow {
    font-size: 0.8rem;
    color: var(--primary);
}

.table-to {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ==================== RATING SYSTEM ==================== */
.rating-system {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.rating-container {
    text-align: center;
}

.rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.rating-stars-area {
    cursor: pointer;
}

.stars-wrapper {
    display: inline-flex;
    gap: 0.3rem;
}

.star {
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #ffc107;
}

.star:hover {
    transform: scale(1.1);
}

.rating-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.average-stars {
    font-size: 0.9rem;
    color: #ffc107;
}

.rating-count {
    color: var(--text-light);
    font-size: 0.8rem;
}

.rating-comment-area {
    margin-top: 1rem;
}

.rating-textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    resize: vertical;
    font-size: 0.85rem;
}

.rating-buttons {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.8rem;
    justify-content: flex-end;
}

.rating-submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.rating-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.rating-cancel-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.rating-cancel-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.rating-message {
    margin-top: 0.8rem;
    font-size: 0.8rem;
}

/* ==================== FOOTER NOTE ==================== */
.footer-note {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-light);
}

.footer-note p {
    margin: 0.3rem 0;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 968px) {
    .agecalc-input-group {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .date-input-card[style*="display: flex"] {
        display: flex !important;
        justify-content: center !important;
    }
}

@media (max-width: 768px) {
    .agecalc-container {
        padding: 0 1rem;
    }
    
    .agecalc-title {
        font-size: 2rem;
    }
    
    .agecalc-heart {
        font-size: 1.8rem;
    }
    
    .agecalc-subtitle {
        font-size: 0.9rem;
    }
    
    .agecalc-card {
        padding: 1.2rem;
    }
    
    .date-input-card {
        padding: 1rem;
    }
    
    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .additional-info {
        grid-template-columns: 1fr;
    }
    
    .reference-grid {
        grid-template-columns: 1fr;
    }
    
    .agecalc-actions {
        justify-content: center;
    }
    
    .action-btn,
    .primary-action-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
    
    .table-row {
        flex-direction: column;
        text-align: center;
        gap: 0.3rem;
    }
    
    .rating-header {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .agecalc-title {
        font-size: 1.5rem;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .info-row {
        flex-direction: column;
        text-align: center;
    }
    
    .star {
        font-size: 1rem;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agecalc-results {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.primary-action-btn:active,
.action-btn:active {
    animation: pulse 0.2s ease;
}

@keyframes waterDrop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.age-main-display {
    animation: waterDrop 0.5s ease;
}

/* ==================== LOADING STATE ==================== */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== ERROR STATE ==================== */
.date-input.error {
    border-color: var(--error);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-message {
    color: var(--error);
    font-size: 0.7rem;
    margin-top: 0.3rem;
    display: block;
}

/* ==================== SUCCESS STATE ==================== */
.date-input.success {
    border-color: var(--success);
}

.success-message {
    color: var(--success);
    font-size: 0.7rem;
    margin-top: 0.3rem;
    display: block;
}

/* ==================== TOOLTIP ==================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.8rem;
    background: var(--surface);
    color: var(--text);
    font-size: 0.7rem;
    border-radius: 8px;
    white-space: nowrap;
    display: none;
    z-index: 1000;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-family: 'Poppins', sans-serif;
}

[data-tooltip]:hover:before {
    display: block;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .agecalc-container {
        margin: 0;
        padding: 0;
    }
    
    .primary-action-btn,
    .action-btn,
    .quick-btn,
    .rating-system,
    .footer-note {
        display: none;
    }
    
    .agecalc-card {
        box-shadow: none;
        border: 1px solid #ddd;
        padding: 1rem;
    }
    
    .date-input {
        border: 1px solid #ddd;
        background: white;
        color: black;
    }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.date-input:focus-visible,
select.date-input:focus-visible,
.primary-action-btn:focus-visible,
.action-btn:focus-visible,
.star:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==================== SCROLLBAR STYLING ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==================== SELECT OPTIONS DARK MODE ==================== */
@media (prefers-color-scheme: dark) {
    select.date-input option {
        background: var(--surface);
        color: var(--text);
    }
}

/* ==================== DISABLED STATE ==================== */
.date-input:disabled,
.primary-action-btn:disabled,
.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== HIGH CONTRAST MODE ==================== */
@media (prefers-contrast: high) {
    .date-input,
    select.date-input {
        border-width: 2px;
    }
    
    .primary-action-btn,
    .action-btn {
        border: 1px solid currentColor;
    }
    
    .result-card,
    .ref-card {
        border-width: 2px;
    }
}

/* ==================== UTILITY CLASSES ==================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ==================== VOLUME SPECIFIC STYLES ==================== */
/* Special styling for volume units badge */
.volume-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Liquid drop animation for volume converter */
@keyframes liquidDrop {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.agecalc-card {
    animation: liquidDrop 0.4s ease;
}