/* ==========================================================================
   Professional Theme - Sander7100
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #0f172a;      /* Slate 900 */
    --surface: #1e293b;      /* Slate 800 */
    --surface-hover: #334155;/* Slate 700 */
    --surface-border: #334155;
    
    --text-primary: #f8fafc; /* Slate 50 */
    --text-secondary: #94a3b8;/* Slate 400 */
    
    --accent: #f97316;       /* Orange 500 */
    --accent-hover: #ea580c; /* Orange 600 */
    
    --success: #10b981;      /* Emerald 500 */
    --error: #ef4444;        /* Red 500 */

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Effects */
    --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);
    
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p { margin: 0; }

.app-container {
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
}

.header-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(249, 115, 22, 0.2);
}

.header-logo i {
    font-size: 2.5rem;
    color: #fff;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Language Switcher */
.lang-switcher {
    display: inline-flex;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 9999px;
    padding: 0.25rem;
    margin-top: 1.5rem;
    gap: 0.25rem;
}

.lang-switcher a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.lang-switcher a:hover {
    color: var(--text-primary);
}

.lang-switcher a.active {
    background: var(--surface-hover);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.lang-switcher .divider {
    width: 1px;
    background: var(--surface-border);
    margin: 0.25rem 0.25rem;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.app-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0 1.5rem 2rem;
}

.app-nav button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--surface-border);
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-main);
    cursor: pointer;
    border-radius: 9999px; /* Pill shape */
    transition: var(--transition);
}

.app-nav button i {
    font-size: 1.25rem;
}

.app-nav button:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.app-nav button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.app-main {
    flex: 1;
    padding: 0 1.5rem;
}

.tab-content {
    display: none;
    animation: fadeUp 0.4s ease-out forwards;
}

.tab-content.active {
    display: block;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 2rem;
    text-align: center;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-header h2 i {
    color: var(--accent);
}

.section-desc {
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Layout Grids */
.grid-layout {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeUpCard 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeUpCard {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.grid-layout .card:nth-child(1) { animation-delay: 0.1s; }
.grid-layout .card:nth-child(2) { animation-delay: 0.2s; }
.grid-layout .card:nth-child(3) { animation-delay: 0.3s; }
.grid-layout .card:nth-child(4) { animation-delay: 0.4s; }
.grid-layout .card:nth-child(5) { animation-delay: 0.5s; }
.grid-layout .card:nth-child(6) { animation-delay: 0.6s; }

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.card-header i {
    font-size: 1.5rem;
    color: var(--accent);
    background: rgba(249, 115, 22, 0.1);
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface-border);
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.pro-form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.input-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding-right: 2.5rem; /* Space for unit */
}

.input-wrapper .unit {
    position: absolute;
    right: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    pointer-events: none;
}

input[type="number"], select {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
    appearance: none;
}

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* Custom Select Arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto; /* Push to bottom of card */
}

.form-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    transition: var(--transition);
    flex: 1;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--surface-border) !important;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

.full-width {
    width: 100%;
}

/* ==========================================================================
   Results & Data Lists (Cheat Sheets)
   ========================================================================== */
.result-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    animation: fadeUp 0.3s ease-out;
}

.result-box.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.result-box.hidden {
    display: none;
}

.data-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.data-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--surface-border);
}

.data-list li:last-child {
    border-bottom: none;
}

.data-list li span {
    color: var(--text-secondary);
}

.data-list li strong {
    font-weight: 600;
}

.data-list small {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 0.75em;
}

.color-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.card-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.card-note i {
    color: var(--accent);
    margin-top: 0.1rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    text-align: center;
    padding: 3rem 1.5rem;
    margin-top: 2rem;
    color: var(--text-secondary);
}

.app-footer p {
    font-size: 0.9rem;
}

.sub-footer {
    font-size: 0.8rem !important;
    opacity: 0.7;
    margin-top: 0.25rem !important;
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */
@media (max-width: 600px) {
    /* Bottom Tab Bar Navigation */
    .app-nav.bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        padding: 0.5rem 0.5rem max(0.5rem, env(safe-area-inset-bottom));
        border-top: 1px solid var(--surface-border);
        flex-direction: row;
        justify-content: space-around;
        gap: 0;
        z-index: 1000;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
    }
    
    .app-nav.bottom-nav button {
        flex-direction: column;
        width: auto;
        padding: 0.5rem;
        background: transparent;
        border: none;
        border-radius: var(--radius-md);
        gap: 0.25rem;
        flex: 1;
    }
    
    .app-nav.bottom-nav button i {
        font-size: 1.5rem;
    }

    .app-nav.bottom-nav button span {
        font-size: 0.75rem;
        font-weight: 500;
    }

    .app-nav.bottom-nav button.active {
        color: var(--accent);
        background: transparent;
        box-shadow: none;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .data-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}
