/*
 * POS Cards RTL CSS - Specialized styles for POS Cards pages
 * Built on modset-rtl.css variables and patterns  
 * Compatible with RTL layouts (Arabic)
 */

/* ========== CSS VARIABLES WITH FALLBACKS ========== */
:root {
    --primary-color: #4b1e1e;
    --secondary-color: #e39823;
    --primary-light: #6b2c2c;
    --primary-dark: #3a1616;
    --primary-gradient: linear-gradient(225deg, #4b1e1e 0%, #6b2c2c 50%, #4b1e1e 100%);
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --shadow-light: rgba(75, 30, 30, 0.1);
    --shadow-medium: rgba(75, 30, 30, 0.15);
    --radius-small: 6px;
    --radius-medium: 10px;
    --font-weight-medium: 500;
    --font-weight-normal: 400;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ========== POS CARDS HEADER RTL ========== */
.pos-cards-header {
    background: var(--primary-gradient, linear-gradient(225deg, #4b1e1e 0%, #6b2c2c 50%, #4b1e1e 100%));
    color: white;
    padding: 60px 0 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    direction: rtl;
}

.pos-cards-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="cards" patternUnits="userSpaceOnUse" width="20" height="20"><rect fill="rgba(255,255,255,0.02)" width="20" height="20"/><circle fill="rgba(255,255,255,0.03)" cx="10" cy="10" r="2"/></pattern></defs><rect fill="url(%23cards)" width="100" height="100"/></svg>');
    opacity: 0.3;
}

.pos-cards-header .container {
    position: relative;
    z-index: 2;
}

.pos-cards-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.pos-cards-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
    text-align: center;
}

/* ========== POS CARDS GOVERNORATE GRID RTL ========== */
.pos-cards-governorate-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--transition-normal, 0.3s ease);
}

.pos-cards-governorate-card {
    background: var(--white, #ffffff);
    border: 1px solid var(--border-color, #e9ecef);
    border-radius: var(--radius-medium, 10px);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px var(--shadow-light, rgba(75, 30, 30, 0.1));
    transition: var(--transition-normal, 0.3s ease);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
    flex-direction: row-reverse;
}

.pos-cards-governorate-card:hover {
    box-shadow: 0 4px 16px var(--shadow-medium, rgba(75, 30, 30, 0.15));
    transform: translateY(-2px);
    border-color: var(--primary-color, #4b1e1e);
}

.pos-cards-governorate-title {
    font-size: 16px;
    font-weight: var(--font-weight-medium, 500);
    color: var(--text-dark, #2c3e50);
    margin: 0;
    flex: 1;
    text-align: right;
}

.pos-cards-governorate-icon {
    color: var(--primary-color, #4b1e1e);
    font-size: 18px;
    opacity: 0.7;
    transition: var(--transition-fast, 0.2s ease);
    transform: rotate(180deg);
}

.pos-cards-governorate-card:hover .pos-cards-governorate-icon {
    opacity: 1;
    transform: rotate(180deg) translateX(5px);
}

/* ========== POS CARDS TABLE STYLES RTL ========== */
.pos-cards-container {
    box-shadow: 0 4px 20px var(--shadow-light, rgba(75, 30, 30, 0.1));
    border: 1px solid var(--border-color, #e9ecef);
    direction: rtl;
}

.pos-cards-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
}

.pos-cards-header {
    background: var(--primary-color, #4b1e1e) !important;
    border-color: var(--primary-color, #4b1e1e) !important;
    color: var(--white, #ffffff) !important;
    font-weight: var(--font-weight-medium, 500);
    padding: 15px 12px;
    text-align: center;
    vertical-align: middle;
    border: none;
    position: relative;
}

.pos-cards-header:first-child {
    border-top-right-radius: var(--radius-small, 6px);
}

.pos-cards-header:last-child {
    border-top-left-radius: var(--radius-small, 6px);
}

.pos-cards-row {
    transition: var(--transition-fast, 0.2s ease);
}

.pos-cards-row:hover {
    background-color: rgba(75, 30, 30, 0.02);
}

.pos-cards-cell {
    padding: 12px;
    vertical-align: middle;
    border-color: var(--border-color, #e9ecef);
    text-align: right;
}

.pos-cards-number {
    width: 3%;
    text-align: center;
    font-weight: var(--font-weight-medium, 500);
    color: var(--text-muted, #6c757d);
}

.pos-cards-name {
    width: 37%;
    font-weight: var(--font-weight-medium, 500);
    color: var(--text-dark, #2c3e50);
    text-align: right;
}

.pos-cards-address {
    width: 30%;
    color: var(--text-dark, #2c3e50);
    line-height: 1.4;
    text-align: right;
}

.pos-cards-phone {
    width: 10%;
    text-align: center;
}

.pos-cards-phone-link {
    color: var(--primary-color, #4b1e1e);
    text-decoration: none;
    font-weight: var(--font-weight-medium, 500);
    transition: var(--transition-fast, 0.2s ease);
    direction: ltr;
    display: inline-block;
}

.pos-cards-phone-link:hover {
    color: var(--primary-dark, #3a1616);
    text-decoration: underline;
}

.pos-cards-location {
    width: 20%;
    text-align: center;
}

.pos-cards-location-link {
    color: var(--primary-color, #4b1e1e);
    text-decoration: none;
    font-weight: var(--font-weight-medium, 500);
    transition: var(--transition-fast, 0.2s ease);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-direction: row-reverse;
}

.pos-cards-location-link:hover {
    color: var(--primary-dark, #3a1616);
    text-decoration: none;
}

.pos-cards-location-icon {
    font-size: 18px;
}

/* ========== NO RESULTS STATE RTL ========== */
.pos-cards-no-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    box-shadow: 0 2px 8px var(--shadow-light);
    direction: rtl;
}

.pos-cards-no-results h5 {
    color: var(--text-muted);
    font-weight: var(--font-weight-normal);
}

/* ========== RESPONSIVE DESIGN RTL ========== */
@media (max-width: 768px) {
    .pos-cards-container {
        padding: 15px !important;
        overflow-x: auto;
    }
    
    .pos-cards-table {
        min-width: 600px;
    }
    
    .pos-cards-header,
    .pos-cards-cell {
        padding: 8px 6px;
        font-size: 14px;
    }
    
    .pos-cards-governorate-card {
        padding: 15px;
        min-height: 65px;
    }
    
    .pos-cards-governorate-title {
        font-size: 14px;
    }
    
    .pos-cards-location-link {
        font-size: 12px;
    }
    
    .pos-cards-location-icon {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .pos-cards-header,
    .pos-cards-cell {
        padding: 6px 4px;
        font-size: 12px;
    }
    
    .pos-cards-governorate-card {
        padding: 12px;
        min-height: 60px;
    }
    
    .pos-cards-governorate-title {
        font-size: 13px;
    }
}

/* ========== TABLE SPECIFIC ENHANCEMENTS RTL ========== */
#posCardsTable thead th {
    position: sticky;
    top: 0;
    z-index: 10;
}

#posCardsTable tbody tr:last-child td:first-child {
    border-bottom-right-radius: var(--radius-small);
}

#posCardsTable tbody tr:last-child td:last-child {
    border-bottom-left-radius: var(--radius-small);
}

/* ========== LOADING STATE RTL ========== */
.pos-cards-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    direction: rtl;
}

.pos-cards-loading i {
    font-size: 32px;
    margin-bottom: 15px;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

/* ========== RTL SPECIFIC ADJUSTMENTS ========== */
[dir="rtl"] .pos-cards-governorate-card {
    text-align: right;
}

[dir="rtl"] .pos-cards-table th,
[dir="rtl"] .pos-cards-table td {
    text-align: right;
}

[dir="rtl"] .pos-cards-number,
[dir="rtl"] .pos-cards-phone,
[dir="rtl"] .pos-cards-location {
    text-align: center;
}

/* Arabic font enhancements */
[lang="ar"] .pos-cards-governorate-title,
[lang="ar"] .pos-cards-name,
[lang="ar"] .pos-cards-address {
    font-family: 'Cairo', 'Tajawal', 'Amiri', Arial, sans-serif;
    font-weight: 500;
}