/* Import Google Fonts for Arabic and English */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&family=Roboto:wght@400;700&display=swap');

/* Define CSS Variables */
:root {
    --vodafone-red: #e60001;
    --vodafone-red-dark: #b00000;
    --background-gray: #f0f2f5;
    --light-gray: #f9f9f9;
    --border-color: #ddd;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --arabic-font: 'Cairo', 'Noto Sans Arabic', 'Arial', sans-serif;
    --english-font: 'Roboto', 'Segoe UI', 'Open Sans', sans-serif;
}

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

/* Base Styles */
body {
    background-color: var(--background-gray);
    font-family: var(--arabic-font); /* Default to Arabic font */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    direction: rtl; /* Default to RTL for Arabic */
    padding: 20px;
}

/* Language-Specific Font and Direction */
[lang="ar"] {
    font-family: var(--arabic-font);
    direction: rtl;
}

[lang="en"] {
    font-family: var(--english-font);
    direction: ltr;
}

/* Container */
.container {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 700px;
    transition: all 0.3s ease;
}

/* Headings */
h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--vodafone-red);
    font-size: 1.6em;
}

/* Form Inputs */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1em;
    transition: border-color 0.2s ease;
    font-family: inherit; /* Inherit font based on parent language */
}

/* Focus States */
input:focus,
select:focus {
    outline: none;
    border-color: var(--vodafone-red);
}

/* Buttons */

 button {
        width: 100%;
        padding: 14px;
        background-color: var(--vodafone-red);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: bold;
        cursor: pointer;
        transition: background-color 0.3s ease;
            font-family: var(--arabic-font); /* Buttons default to Arabic */
    }

    button:hover {
        background-color: var(--vodafone-red-dark);
    }
    



.logout-button {
    background-color: var(--vodafone-red);
    border: 1px solid #ddd;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    text-align: center;
    flex-grow: 1; 
}

.logout-button:hover {
    background-color: var(--vodafone-red-dark);
}

/* Messages */
.message {
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
}

.success { color: green; }
.error { color: red; }

/* Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    gap: 5px;
}

.tab {
    flex: 1 1 auto;
    padding: 10px;
    text-align: center;
    background-color: #f0f0f0;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: background-color 0.2s ease;
}

.tabb {
    flex: 1 1 auto;
    padding: 10px;
    text-align: center;
    background-color: #f0f0f0;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: background-color 0.2s ease;
}


.tab.active {
    background-color: var(--vodafone-red);
    color: white;
    font-weight: bold;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

/* Disabled Elements */
.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* Fade Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Plan Card */
.plan-card {
    background-color: #fff;
    border: 2px solid var(--vodafone-red);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    color: #222;
    line-height: 1.8;
    box-shadow: var(--shadow);
    max-width: 90%;
    margin-right: auto;
    margin-left: auto;
}

.plan-title {
    background-color: var(--vodafone-red);
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.plan-list {
    list-style: disc;
    padding-right: 20px;
}

.plan-list li {
    margin-bottom: 8px;
    font-size: 1rem;
}

.plan-error {
    color: var(--vodafone-red-dark);
    font-weight: bold;
    text-align: center;
    padding: 10px;
    background-color: #fff0f0;
    border: 1px solid var(--vodafone-red);
    border-radius: 6px;
    max-width: 80%;
    margin: 20px auto;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    height: 22px;
    margin: 10px 0;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--vodafone-red);
    width: 0;
    transition: width 0.4s ease-in-out;
}

/* Consumption Table */
.consumption-table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
}

.consumption-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.95em;
    background-color: #fff;
    box-shadow: var(--shadow);
}

.consumption-table th,
.consumption-table td {
    padding: 12px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.consumption-table th {
    background-color: var(--vodafone-red);
    color: white;
    font-weight: bold;
}

.consumption-table tr:nth-child(even) {
    background-color: var(--light-gray);
}

.consumption-table tr:hover {
    background-color: #f1f1f1;
}

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 1rem;
}

.logo img {
    width: 120px;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 16px;
    background-color: var(--vodafone-red);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.pagination-btn:hover {
    background-color: var(--vodafone-red-dark);
}

.pagination span {
    font-size: 0.9em;
    color: #333;
}

/* Form Container */
.form-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 5px;
    justify-content: space-evenly;
}

.form-container button {
    padding: 10px 20px;
    font-size: 14px;
width:auto;
    
}






/* Responsive Design */
@media screen and (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h2 {
        font-size: 1.3em;
    }

    input,
    select {
        font-size: 0.95em;
    }

    button {
        font-size: 0.95em;
    }

    .pagination-btn {
        padding: 6px 12px;
    }
    
    
    
}

@media screen and (max-width: 480px) {
    /*.tabs {*/
    /*    flex-direction: column;*/
    /*}*/

    .consumption-table {
        font-size: 0.85em;
    }

    .consumption-table th,
    .consumption-table td {
        padding: 8px;
    }

    .consumption-table thead {
        display: none;
    }

    .consumption-table tbody,
    .consumption-table tr {
        display: block;
    }

    .consumption-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background-color: #fff;
        box-shadow: var(--shadow);
    }

    .consumption-table td {
        display: flex;
        justify-content: space-between;
        padding: 10px 12px;
        border: none;
        border-bottom: 1px solid #eee;
        white-space: normal;
        text-align: right;
    }

    .consumption-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #333;
        flex: 0 0 45%;
    }

    .consumption-table td:last-child {
        border-bottom: none;
    }
}