/* AIN RADIO 98.3 - UNIVERSAL RESPONSIVE STYLE
   Compatible with: Phonebook & Note Tracking Systems
   Theme: Red, Dark Charcoal, & Off-White
*/

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&display=swap');

:root {
    /* Brand Colors */
    --ain-red: #c8102e;
    --ain-red-dark: #a00d24;
    --ain-red-glow: rgba(200, 16, 46, 0.1);
    --dark-surface: #1a1a1b;
    --bg-light: #f4f7f6;
    --text-main: #2d3436;
    --text-muted: #636e72;
    
    /* Status Colors */
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;

    /* UI Tokens */
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.06);
    --transition: all 0.2s ease-in-out;
}

/* --- Base Styles --- */
body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    background-color: var(--bg-light);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    font-size: 0.9rem;
    padding-bottom: 40px;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Typography --- */
h1, h2, h3, .fw-bold { font-weight: 700; }
.text-ain-red { color: var(--ain-red); }

/* --- Navbar --- */
.navbar {
    background: var(--dark-surface) !important;
    padding: 10px 0;
    border-bottom: 4px solid var(--ain-red);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 900;
    font-size: 1.4rem;
    color: #fff !important;
    letter-spacing: 1px;
}

.navbar-brand span { color: var(--ain-red); }

/* --- Cards & Surfaces --- */
.card {
    border: none;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f1f1f1;
    padding: 15px 20px;
    color: var(--ain-red);
    font-weight: 800;
}

/* --- Forms & Inputs --- */
.form-control, .form-select {
    border: 2px solid #eef2f3;
    border-radius: var(--radius-md);
    padding: 10px 15px;
    font-family: 'Cairo';
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--ain-red);
    box-shadow: 0 0 0 3px var(--ain-red-glow);
}

/* --- Buttons --- */
.btn {
    font-family: 'Cairo';
    font-weight: 700;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-primary { background: var(--ain-red); border: none; color: white; }
.btn-primary:hover { background: var(--ain-red-dark); transform: translateY(-1px); }

.btn-secondary { background: #636e72; border: none; color: white; }

/* --- Tables (Desktop View) --- */
.table-responsive {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.table thead th {
    background-color: var(--dark-surface);
    color: white;
    padding: 15px;
    font-weight: 600;
    border: none;
    text-align: right;
}

.table tbody td {
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #fffcfc;
}

/* --- Status Badges --- */
.badge-status {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.bg-yes { background-color: #d4edda; color: #155724; }
.bg-no { background-color: #f8d7da; color: #721c24; }

/* --- Search Bar Decoration --- */
.search-wrapper {
    position: relative;
    margin-bottom: 25px;
}

#searchInput {
    padding-right: 45px;
    font-size: 1.1rem;
    border-width: 2px;
}

/* --- MEDIA QUERIES (The Advanced Mobile Logic) --- */

@media (max-width: 768px) {
    /* Adjust Container */
    .container { width: 92%; }

    /* Hide Headers */
    .table thead { display: none; }

    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: var(--radius-lg);
        background: #fff;
        padding: 10px;
        box-shadow: var(--shadow-soft);
    }

    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left !important;
        padding: 10px 15px;
        border-bottom: 1px solid #f8f8f8;
    }

    .table td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-top: 15px;
    }

    /* Mobile Labels */
    .table td::before {
        content: attr(data-label);
        font-weight: 800;
        color: var(--ain-red);
        flex: 1;
        text-align: right;
        font-size: 0.85rem;
    }

    /* Actions buttons on mobile */
    .btn-group {
        display: flex;
        width: 100%;
        gap: 5px;
    }
    
    .btn-group .btn {
        flex: 1;
    }

    /* Form adjustment */
    .btn { width: 100%; }
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--ain-red); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ain-red-dark); }