/* Polso Regale Loyalty Program - Main Stylesheet */
:root {
    --primary-color: #163e58;
    --secondary-color: #000000;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--secondary-color);
    background-color: var(--light-gray);
}

/* RTL Support for Arabic */
[dir="rtl"] body {
    font-family: 'Segoe UI', 'Arial', 'Tahoma', sans-serif;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color), #1a4a6b);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.header h1 {
    font-size: 2rem;
    font-weight: 300;
    text-align: center;
}

.header .subtitle {
    text-align: center;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Navigation */
.nav {
    background: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav a:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* RTL Navigation */
[dir="rtl"] .nav ul {
    flex-direction: row-reverse;
}

/* Form Styles */
.form-container {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 62, 88, 0.1);
}

/* RTL Form Controls */
[dir="rtl"] .form-control {
    text-align: right;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #1a4a6b;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--secondary-color);
}

.btn-info {
    background: var(--info);
    color: var(--white);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--success);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--warning);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info);
}

/* RTL Alert Messages */
[dir="rtl"] .alert {
    border-left: none;
    border-right: 4px solid;
}

[dir="rtl"] .alert-success {
    border-right-color: var(--success);
}

[dir="rtl"] .alert-error {
    border-right-color: var(--danger);
}

[dir="rtl"] .alert-warning {
    border-right-color: var(--warning);
}

[dir="rtl"] .alert-info {
    border-right-color: var(--info);
}

/* Table Styles */
.table-container {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 500;
}

.table tr:hover {
    background: #f8f9fa;
}

.table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

/* RTL Table Styles */
[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.card-body {
    color: var(--gray);
}

.card-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
}

/* Search Box */
.search-container {
    margin: 1rem 0;
}

.search-box {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* RTL Search Box */
[dir="rtl"] .search-box {
    text-align: right;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* RTL Action Buttons */
[dir="rtl"] .action-buttons {
    flex-direction: row-reverse;
}

/* Points Display */
.points-display {
    background: linear-gradient(135deg, var(--primary-color), #1a4a6b);
    color: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    margin: 1rem 0;
}

.points-value {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
}

.points-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* WhatsApp Button */
.whatsapp-btn {
    background: #25d366;
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.whatsapp-btn:hover {
    background: #128c7e;
    transform: translateY(-2px);
    color: var(--white);
}

/* Language Switcher */
.language-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;
}

[dir="rtl"] .language-switcher {
    right: auto;
    left: 1rem;
}

/* WhatsApp Order Styles */
.whatsapp-container {
    text-align: center;
    padding: 3rem 1rem;
}

.whatsapp-icon {
    font-size: 5rem;
    color: #25d366;
    margin-bottom: 2rem;
}

.whatsapp-message {
    background: #f8f9fa;
    border: 2px solid #25d366;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: left;
    direction: ltr;
}

.whatsapp-message pre {
    white-space: pre-wrap;
    font-family: inherit;
    margin: 0;
    line-height: 1.6;
}

.redirect-timer {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 1rem 0;
}

.manual-button {
    margin: 1rem;
}

.customer-info {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.whatsapp-quick-order {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    margin: 1rem 0;
}

.whatsapp-quick-order h3 {
    margin-bottom: 1rem;
}

.whatsapp-quick-order .btn {
    background: white;
    color: #25d366;
    font-weight: bold;
}

.whatsapp-order-btn {
    background: #25d366;
    color: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    display: inline-block;
    margin: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.whatsapp-order-btn:hover {
    background: #128c7e;
    transform: translateY(-2px);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .points-value {
        font-size: 2rem;
    }
    
    .language-switcher {
        position: static;
        text-align: center;
        margin: 1rem 0;
    }
    
    [dir="rtl"] .language-switcher {
        position: static;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .nav,
    .btn,
    .action-buttons,
    .language-switcher {
        display: none !important;
    }
    
    .table-container {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Arabic Font Support */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

[dir="rtl"] body {
    font-family: 'Cairo', 'Segoe UI', 'Arial', sans-serif;
}

[dir="rtl"] .btn,
[dir="rtl"] .form-control,
[dir="rtl"] .search-box {
    font-family: 'Cairo', 'Segoe UI', 'Arial', sans-serif;
} 