/* ===== RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #2E7D32;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --secondary-color: #FF6F00;
    --secondary-light: #FFB74D;
    --accent-color: #1976D2;
    
    /* Neutral Colors */
    --white: #FFFFFF;
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F4;
    --gray-200: #E8EAED;
    --gray-300: #DADCE0;
    --gray-400: #BDC1C6;
    --gray-500: #9AA0A6;
    --gray-600: #5F6368;
    --gray-700: #3C4043;
    --gray-800: #202124;
    --gray-900: #1A1A1A;
    
    /* Semantic Colors */
    --success-color: #34A853;
    --warning-color: #FBBC04;
    --error-color: #EA4335;
    --info-color: #4285F4;
    
    /* Typography */
    --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-weigth-base: 500;
    
    /* Spacing */
    --space-1: 0.2rem;
    --space-2: 0.4rem;
    --space-3: 0.6rem;
    --space-4: 0.8rem;
    --space-5: 1rem;
    --space-6: 1.2rem;
    --space-8: 1.6rem;
    --space-10: 2rem;
    --space-12: 2.4rem;
    --space-16: 3.2rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 250ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weigth-base);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== LAYOUT ===== */
.app {
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4);
}

.body {
    padding: var(--space-4);
}

.container {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-4);
    color: var(--gray-900);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p {
    margin-bottom: var(--space-4);
}

/* ===== BUTTONS ===== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-lg);
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    min-height: 44px; /* Touch target size */
    font-family: inherit;
    
    /* Primary Button */
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.button:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.button:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Button Variants */
.button--secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.button--secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.button--outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.button--small {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    min-height: 36px;
}

.button--large {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
    min-height: 52px;
}

.password-div {
    display: flex;
    flex-direction: row;
}

/* ===== ICON BUTTON ===== */
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: var(--space-2);
    background-color: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.icon-button:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.icon-button:active {
    transform: translateY(0);
}

.icon-button img {
    width: 24px;
    height: 24px;
    transition: transform var(--transition-fast);
}

.icon-button:hover img {
    transform: scale(1.1);
}

/* ===== CARDS ===== */
.card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card .name {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-3);
}

/* Mini Card */
.mini-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
    min-height: 60px;
}

.mini-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.mini-card .name {
    font-size: var(--font-size-lg);
    font-weight: 500;
    margin: 0;
    flex: 1;
}

.mini-card .checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Creation Card */
.creation-card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    max-width: 500px;
    margin: 0 auto;
}

.creation-card label {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900);
    text-align: center;
    display: block;
    margin-bottom: var(--space-6);
}

/* Consumer with Orders Card */
.consumer-with-orders-card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--space-2);
}

/* ===== FORMS ===== */
.forms {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.input-group {
    position: relative;
    margin-bottom: var(--space-5);
}

.input-group label {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-size: var(--font-size-base);
    pointer-events: none;
    transition: all var(--transition-normal);
    background-color: var(--white);
    padding: 0 var(--space-1);
    z-index: 1;
}

.creation-input,
.search-input {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--font-size-base);
    font-family: inherit;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    background-color: var(--white);
    transition: all var(--transition-normal);
    min-height: 48px;
}

.creation-input:focus,
.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.creation-input:focus ~ label,
.creation-input:not(:placeholder-shown) ~ label,
.search-input:focus ~ label,
.search-input:not(:placeholder-shown) ~ label {
    top: 0;
    font-size: var(--font-size-sm);
    color: var(--primary-color);
    font-weight: 500;
}

/* Auth Forms */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: var(--space-8);
}

.auth-form {
    width: 100%;
    max-width: 400px;
    background-color: var(--white);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.auth-form input {
    width: 100%;
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-lg);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-normal);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ===== TEXT WITH LABEL ===== */
.text-with-label {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.label-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-weight: 500;
}

.text-content {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--gray-900);
    word-break: break-word;
}

.icon-label {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.7;
}

/* ===== EDITABLE TEXT ===== */
.editable-text {
    flex: 1;
}

.editable-text input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-lg);
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background-color: var(--gray-100);
    transition: all var(--transition-normal);
}

.editable-text input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* ===== LISTS ===== */
ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    margin: 0;
    padding: 0;
}

/* ===== CHECKBOXES ===== */
.creation-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* ===== ERROR HANDLING ===== */
#error-popup {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    max-width: 350px;
    background-color: var(--white);
    border: 2px solid var(--error-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    display: none;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.error-text {
    color: var(--error-color);
    font-weight: 500;
    margin: 0;
}

.close-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--error-color);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.close-btn:hover {
    background-color: var(--gray-100);
}

/* ===== UTILITIES ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-4 { margin-bottom: var(--space-4); }
.mt-4 { margin-top: var(--space-4); }
.mx-auto { margin-left: auto; margin-right: auto; }

.hidden { display: none !important; }
.block { display: block !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile First - Base styles above are for mobile */

/* Small tablets and large phones (landscape) */
@media (min-width: 576px) {
    .app {
        padding: var(--space-6);
    }
    
    .card {
        padding: var(--space-8);
    }
    
    .mini-card {
        padding: var(--space-5);
    }
    
    .forms {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-4);
    }
    
    .forms > * {
        flex: 1;
        min-width: 250px;
    }
}

/* Tablets */
@media (min-width: 768px) {
    .app {
        padding: var(--space-6);
    }
    
    .container {
        gap: var(--space-6);
    }
    
    .card {
        display: flex;
        align-items: center;
        gap: var(--space-6);
    }
    
    .card .name {
        flex: 0 0 200px;
        margin-bottom: 0;
    }
    
    .text-with-label {
        flex: 1;
    }
    
    .auth-container {
        padding: var(--space-12);
    }
}

/* Small desktops */
@media (min-width: 992px) {
    .app {
        padding: var(--space-8);
    }
    
    .container {
        gap: var(--space-6);
    }
    
    .card {
        padding: var(--space-10);
    }
    
    .forms {
        gap: var(--space-6);
    }
}

/* Large desktops */
@media (min-width: 1200px) {
    .app {
        padding: var(--space-6);
    }
    
    .container {
        gap: var(--space-6);
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --gray-200: #000000;
        --gray-300: #000000;
        --shadow-sm: 0 0 0 1px #000000;
        --shadow-md: 0 0 0 2px #000000;
        --shadow-lg: 0 0 0 3px #000000;
    }
}

/* Dark mode support
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1A1A1A;
        --gray-50: #121212;
        --gray-100: #1E1E1E;
        --gray-200: #2D2D2D;
        --gray-300: #404040;
        --gray-400: #5F5F5F;
        --gray-500: #7F7F7F;
        --gray-600: #ABABAB;
        --gray-700: #C7C7C7;
        --gray-800: #E1E1E1;
        --gray-900: #F1F1F1;
    }
    
    body {
        background-color: var(--gray-50);
        color: var(--gray-800);
    }
}
 */
/* Print styles */
@media print {
    .button,
    .icon-button,
    #error-popup {
        display: none !important;
    }
    
    .card,
    .mini-card,
    .creation-card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
}
