/* Base styles with RED theme */
:root {
    --primary: #c00000; /* VADIMPEX red */
    --primary-dark: #9a0000;
    --primary-light: #ff4d4d;
    --secondary: #fff0f0; /* Light red background */
    --accent: #e63946;
    --text: #2d3748;
    --light-text: #718096;
    --border: #e0c0c0;
    --row-even: #ffffff;
    --row-odd: #fff5f5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    line-height: 1.6;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fafafa;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 25px;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    height: 70px;
    margin-right: 20px;
}

/* Contact links */
.contact-info a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.contact-info a:hover {
    text-decoration: underline;
}

.copy-email::after {
    content: ' 📋';
    font-size: 0.8em;
    opacity: 0.6;
}

h1 {
    text-align: center;
    color: var(--primary);
    margin: 25px 0;
    font-size: 2.2rem;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 25px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.search-container, .refresh-container, .export-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

#search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

#clear-search, #refresh-btn, #export-btn {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

#export-btn::after {
    content: "▾";
    margin-left: 8px;
    font-size: 0.8em;
}

#clear-search:hover, #refresh-btn:hover, #export-btn:hover {
    background: var(--primary-dark);
}

#last-updated {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-left: 10px;
}

/* Export options */
#export-options {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
    margin-top: 5px;
}

#export-options button {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

#export-options button:hover {
    background: var(--secondary);
}

.export-container {
    position: relative;
}

/* Table styles */
#products-table {
    margin: 20px 0;
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th {
    background-color: var(--primary);
    color: white;
    text-align: left;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    font-weight: 600;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

/* ALTERNATING ROW COLORS */
tr:nth-child(odd) {
    background-color: var(--row-odd);
}

tr:nth-child(even) {
    background-color: var(--row-even);
}

tr:hover {
    background-color: #ffecec;
}

/* Status indicators */
.status-available {
    color: #2ecc71;
    font-weight: bold;
}
.status-low {
    color: #f39c12;
    font-weight: bold;
}
.status-out {
    color: #e74c3c;
    font-weight: bold;
}

/* Loading and messages */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--light-text);
    font-style: italic;
    font-size: 1.1rem;
}

.error {
    color: #c53030;
    background: #fff5f5;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    margin: 20px 0;
    border-left: 4px solid #c53030;
}

#product-count {
    text-align: right;
    margin-top: 10px;
    font-size: 0.95rem;
    color: var(--light-text);
}

/* Footer */
footer {
    margin-top: 40px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--light-text);
    font-size: 0.9rem;
    background: white;
    padding: 20px;
    border-radius: 10px;
}

#footer-time {
    font-weight: 600;
    color: var(--primary);
}

/* Responsive Design */
@media (max-width: 900px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin: 0 auto 15px;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .export-container {
        width: 100%;
    }
}

@media (max-width: 600px) {
    body {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .contact-info p {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}
