/* Font Display Swap - تحسين Core Web Vitals (LCP) */
/* ملاحظة: font-display: swap يُحسّن LCP بتجنب FOIT */

/* Ad Container - منع Layout Shift (CLS) */
.ad-container {
    min-height: 90px;
    overflow: hidden;
}

:root {
    --primary-color: #10b981;
    /* Emerald 500 */
    --primary-hover: #059669;
    /* Emerald 600 */
    --accent-color: #3b82f6;
    /* Blue 500 */
    --bg-gradient-start: #0f172a;
    /* Slate 900 */
    --bg-gradient-end: #1e293b;
    /* Slate 800 */
    --glass-bg: rgba(255, 255, 255, 0.05);
    /* Very transparent white */
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);
    --radius-xl: 1.5rem;
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 40%);
    animation: pulseBg 10s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Layout */
.container {
    width: 100%;
    max-width: 600px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
}

.landing-container {
    max-width: 800px;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.5));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container:hover .logo-icon {
    transform: scale(1.1) rotate(-8deg);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.logo-container h1 {
    font-size: 2.2rem;
    margin: 0;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #fff, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Navigation Tabs */
.tabs-nav {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    position: relative;
    gap: 0.5rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn i {
    font-size: 1rem;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

/* Content Area */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inputs */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    font-weight: 500;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 0.75rem;
}

input,
select {
    width: 100%;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
    text-align: center;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Fix for Select dropdown text color in some browsers */
select option {
    background: var(--bg-gradient-end);
    color: #fff;
}

.modern-date-input {
    width: 100%;
}

/* Buttons */
.action-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    border-radius: var(--radius-lg);
    color: #fff;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.action-btn:active {
    transform: translateY(0);
}

/* Results */
.hidden {
    display: none !important;
}

.result-card {
    margin-top: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    text-align: center;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.loan-breakdown {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-size: 0.95rem;
}

.breakdown-item span:first-child {
    color: var(--text-muted);
}

.breakdown-item span:last-child {
    font-weight: 700;
}

.result-details {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Age Result Grid */
.result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

@media (min-width: 500px) {
    .result-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.age-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    text-align: center;
}

.age-card h4 {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.age-main {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.age-breakdown {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.age-card.gregorian .age-main {
    color: var(--accent-color);
}

.age-card.hijri .age-main {
    color: var(--primary-color);
}

.next-bday {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: var(--text-main);
}

/* Footer */
.main-footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Age Calendar Choice */
.input-choice {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.choice-group {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    display: flex;
    gap: 0.25rem;
}

.choice-btn {
    padding: 0.5rem 1.5rem;
    border-radius: calc(var(--radius-md) - 0.25rem);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.3s;
    user-select: none;
}

.choice-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.choice-btn.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Landing Page Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.tool-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(16, 185, 129, 0.3);
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.tool-icon i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.tool-card:hover .tool-icon {
    background: var(--primary-color);
    transform: scale(1.1) rotate(5deg);
}

.tool-card:hover .tool-icon i {
    color: #fff;
}

.tool-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.tool-arrow {
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--primary-color);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s;
}

.tool-card:hover .tool-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Back Link Header */
.main-header.with-back {
    position: relative;
    padding-top: 1.5rem;
}

.back-link {
    position: absolute;
    top: 0;
    right: 0;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }

    .date-inputs {
        grid-template-columns: 1fr;
    }

    .logo-icon {
        display: none;
    }
}

/* BMI Calculator Styles */
.bmi-gauge-container {
    margin-top: 1.5rem;
    padding: 1rem 0;
    position: relative;
    width: 100%;
}

.bmi-bar {
    height: 12px;
    width: 100%;
    border-radius: 10px;
    display: flex;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.bmi-segment {
    height: 100%;
    flex: 1;
}

.bmi-segment.underweight {
    background: #3b82f6;
    /* Blue */
    flex: 18.5;
}

.bmi-segment.normal {
    background: #10b981;
    /* Green */
    flex: 6.5;
    /* 25 - 18.5 = 6.5 width relative */
}

.bmi-segment.overweight {
    background: #f59e0b;
    /* Orange */
    flex: 5;
    /* 30 - 25 = 5 */
}

.bmi-segment.obese {
    background: #ef4444;
    /* Red */
    flex: 10;
    /* arbitary end width */
}

/* To make the bar represent real scale roughly */
/* 
   Scale 0 to 40.
   Underweight: 0-18.5
   Normal: 18.5-25
   Overweight: 25-30
   Obese: 30-40+
*/
.bmi-bar {
    display: flex;
}

/* We can just use simple equal segments or try to be proportional. 
   Proportional is harder with flex without exact calc. 
   Let's use a linear gradient instead for a smooth look or just predefined colors with proportional widths percentages manually if needed.
   Actually, flex-grow with the range sizes works well.
*/
.bmi-segment.underweight {
    flex-grow: 18.5;
}

.bmi-segment.normal {
    flex-grow: 6.4;
}

/* 24.9 - 18.5 */
.bmi-segment.overweight {
    flex-grow: 5;
}

/* 29.9 - 25 */
.bmi-segment.obese {
    flex-grow: 10;
}

/* 40 - 30 */


.bmi-marker {
    position: absolute;
    top: 22px;
    /* Just below the bar */
    transform: translateX(50%);
    /* Center the icon on the point */
    color: #fff;
    font-size: 1.2rem;
    transition: left 0.5s ease-out;
    left: 0;
    /* Will be set by JS */
}

.bmi-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
}


/* Period Calculator Styles */
.calendar-highlight {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.highlight-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, background 0.3s ease;
}

.highlight-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

.highlight-item i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.color-period {
    color: #ff6b6b;
}

.color-ovulation {
    color: #4dabf7;
}

.color-fertility {
    color: #51cf66;
}

.date-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #fff;
}

.value-highlight {
    color: var(--primary-color);
    font-weight: 700;
}

.info-card {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border-right: 4px solid var(--primary-color);
    text-align: right;
}

.info-card h4 {
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.info-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Currency Converter Styles */
.converter-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.currency-selection {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: flex-end;
}

.swap-container {
    padding-bottom: 0.5rem;
}

.swap-btn {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s;
}

.swap-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: rotate(180deg);
}

.custom-select-wrapper {
    position: relative;
    text-align: right;
}

.currency-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.currency-display:hover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.flag-icon {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.currency-code {
    font-weight: 700;
    font-size: 1rem;
}

.currency-list-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-gradient-end);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: none;
    backdrop-filter: blur(20px);
}

.currency-list-dropdown.active {
    display: block;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-bottom: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 0;
    text-align: right;
    position: sticky;
    top: 0;
    z-index: 10;
}

.currency-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.currency-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.result-main-value {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 1rem 0;
    color: var(--primary-color);
}

.rate-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

@media (max-width: 600px) {
    .currency-selection {
        grid-template-columns: 1fr;
    }

    .swap-container {
        display: flex;
        justify-content: center;
        padding: 0;
    }

    .swap-btn {
        transform: rotate(90deg);
    }
}

/* Temperature Converter Meter */
.temp-visual-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
}

.thermometer {
    width: 25px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    position: relative;
    overflow: visible;
    /* To allow bulb overflow if needed, but we chose hidden earlier */
}

/* Glass Bulb at bottom */
.thermometer::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 45px;
    background: inherit;
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    z-index: 1;
}

.mercury-bulb {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    border-radius: 50%;
    z-index: 2;
    transition: background 0.5s ease;
}

.thermometer-body {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    z-index: 2;
}

.mercury {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: var(--primary-color);
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
}

.temp-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 150px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Text Formatter Specific */
.text-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.action-btn.secondary {
    padding: 0.75rem;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.action-btn.secondary:hover {
    background: var(--glass-bg);
}

.notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

/* Password Generator Specific */
.password-display-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

#password-output {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary-color);
    word-break: break-all;
}

.copy-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.copy-icon-btn:hover {
    color: #fff;
}

.strength-meter {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 2rem;
    position: relative;
}

.strength-bar {
    height: 100%;
    border-radius: inherit;
    transition: width 0.4s ease, background 0.4s ease;
}

.strength-text {
    position: absolute;
    right: 0;
    top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.settings-group {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Checkbox Customization */
.check-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.check-container input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 5px;
    position: relative;
}

.check-container:hover .checkmark {
    border-color: var(--primary-color);
}

.check-container input:checked~.checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.check-container input:checked~.checkmark:after {
    display: block;
}

.check-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="range"] {
    accent-color: var(--primary-color);
    height: 6px;
    margin-top: 1rem;
}

/* Text Decorator Specific */
.decoration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.decoration-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-out;
}

.decoration-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.decorated-text {
    font-size: 1.1rem;
    color: #fff;
    word-break: break-all;
}

.copy-small-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    transition: all 0.2s;
}

.copy-small-btn:hover {
    color: var(--primary-color);
}

.no-input-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    user-select: none;
}

/* Math Calculator Specific Styles */
.calculator-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}

.calc-display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: 1px solid var(--glass-border);
    word-break: break-all;
    overflow-x: auto;
}

.calc-prev {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    height: 1.4rem;
    direction: ltr;
}

.calc-current {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    direction: ltr;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.calc-btn {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.calc-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.calc-btn:active {
    transform: translateY(0);
}

.calc-btn.op {
    color: var(--primary-color);
    font-weight: 700;
}

.calc-btn.func {
    color: var(--accent-color);
    font-size: 1rem;
}

.calc-btn.equal {
    background: var(--primary-color);
    grid-column: span 2;
    font-weight: 700;
}

.calc-btn.equal:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-glow);
}

.calc-btn.clear {
    color: #ef4444;
}

@media (max-width: 400px) {
    .calc-grid {
        gap: 0.5rem;
    }

    .calc-btn {
        padding: 1rem;
        font-size: 1.1rem;
    }
}