/**
 * Rewards Webshop - Stylesheet
 * Clips & Paper B2B Office Supplies
 */

/* ============================================
   RESET & BASE
   ============================================ */

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

:root {
    --primary: #1b5e3b;
    --primary-dark: #0d3d26;
    --accent: #e85d04;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ffc107;
    --info: #2196f3;
    --gray-light: #f5f5f5;
    --gray-medium: #ccc;
    --gray-dark: #666;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.2);
    --shadow-heavy: 0 10px 40px rgba(0,0,0,0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wrapper {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-heavy);
    padding: 30px;
    margin: 20px 0;
}

.split-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: white;
    padding: 20px 0;
    box-shadow: var(--shadow-light);
    margin-bottom: 30px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo h1 {
    color: var(--primary);
    font-size: 24px;
}

.header-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-nav a {
    color: var(--primary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.header-nav a:hover {
    background: var(--gray-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: var(--gray-light);
    border-radius: 8px;
}

.points-badge {
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */

.sidebar {
    background: var(--gray-light);
    padding: 20px;
    border-radius: 8px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar a {
    color: #333;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 5px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar a:hover {
    background: white;
    box-shadow: var(--shadow-light);
}

.sidebar a.active {
    background: var(--primary);
    color: white;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: var(--gray-medium);
    cursor: not-allowed;
    transform: none;
}

.btn-accent {
    background: var(--accent);
}

.btn-accent:hover {
    background: #c74d04;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #388e3c;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #c62828;
}

.btn-secondary {
    background: var(--gray-medium);
    color: #333;
}

.btn-secondary:hover {
    background: var(--gray-dark);
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-medium);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group .help-text {
    font-size: 14px;
    color: var(--gray-dark);
    margin-top: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* ============================================
   CARDS & GRIDS
   ============================================ */

.card {
    background: white;
    border: 1px solid var(--gray-medium);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

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

.card-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.card-header h3 {
    color: var(--primary);
    font-size: 20px;
}

.card-body {
    margin-bottom: 15px;
}

.card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-light);
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ============================================
   PRODUCT CARDS
   ============================================ */

.product-card {
    background: white;
    border: 1px solid var(--gray-medium);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

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

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-light);
}

.product-content {
    padding: 15px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.product-description {
    font-size: 14px;
    color: var(--gray-dark);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--gray-light);
}

.product-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
}

.product-price .points {
    font-size: 16px;
    color: var(--gray-dark);
}

.product-retail {
    font-size: 14px;
    color: var(--gray-dark);
    text-decoration: line-through;
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--gray-light);
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid var(--gray-medium);
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-light);
}

table tbody tr:hover {
    background: var(--gray-light);
}

table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */

.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-heavy);
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.modal-header h2 {
    color: var(--primary);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-light);
}

/* ============================================
   LOADING & SPINNERS
   ============================================ */

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid var(--gray-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loading-overlay .spinner {
    border-color: var(--gray-light);
    border-top-color: white;
    width: 60px;
    height: 60px;
}

/* ============================================
   BADGES & LABELS
   ============================================ */

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

/* ============================================
   STATS & DASHBOARD
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-light);
}

.stat-card.accent {
    border-left-color: var(--accent);
}

.stat-card.success {
    border-left-color: var(--success);
}

.stat-card.info {
    border-left-color: var(--info);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-dark);
    text-transform: uppercase;
}

/* ============================================
   SHOPPING CART
   ============================================ */

.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--gray-light);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    background: var(--gray-light);
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary);
    font-weight: bold;
}

.cart-summary {
    background: var(--gray-light);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 2px solid var(--gray-medium);
    font-size: 20px;
    font-weight: bold;
}

/* ============================================
   TRANSACTION HISTORY
   ============================================ */

.transaction {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--gray-light);
}

.transaction:last-child {
    border-bottom: none;
}

.transaction-details {
    flex: 1;
}

.transaction-type {
    font-weight: 600;
    margin-bottom: 3px;
}

.transaction-date {
    font-size: 14px;
    color: var(--gray-dark);
}

.transaction-points {
    font-size: 18px;
    font-weight: bold;
}

.transaction-points.positive {
    color: var(--success);
}

.transaction-points.negative {
    color: var(--danger);
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray-dark);
    margin-bottom: 20px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

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

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

.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.text-muted {
    color: var(--gray-dark);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

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

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .split-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }
    
    table {
        font-size: 14px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .wrapper {
        padding: 15px;
    }
    
    .logo img {
        height: 40px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
}
