/* GLOBAL ------------------------------------------------------------ */
body {
    margin: 0;
    padding: 0;
    font-family: "Inter", Arial, sans-serif;
    background: linear-gradient(135deg, #d9d9d9, #3c6382);
    height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;
}
body.dark {
	background: #1e272e;
}
body.dark .login-box {
	background: #2f3640;
	color: white;
}
body.dark .input-group label {
	color: #dcdde1;
}
body.dark .input-group input {
	background: #353b48;
	border-color: #4b4b4b;
	color: white;
}
body.dark .login-btn {
	background: #00a8ff;
}

/* INPUT GROUP */
.input-group {
    margin-bottom: 18px;
    width: 100%;
}
.input-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
    color: #636e72;
}
.input-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dcdde1;
    border-radius: 8px;
    font-size: 13px;
    transition: 0.2s;
    box-sizing: border-box;
}
.input-group input:focus {
    border-color: #0984e3;
    box-shadow: 0 0 0 3px rgba(9,132,227,0.15);
    outline: none;
}

/* CONTENT WRAPPER --------------------------------------------------- */
.content {
    padding: 30px;
    max-width: 1200px;
    margin: auto;
}
.hidden {
    display: none !important;
}

/* TITLES ------------------------------------------------------------- */
h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3436;
}

/* EXPAND BUTTON ------------------------------------------------------ */
.toggle-btn {
    cursor: pointer;
    font-size: 15px;
    border: none;
    background: none;
    color: #0984e3;
    font-weight: bold;
}

.apply {
    padding: 10px 18px;
    margin: 0 5px;
    background: #0984e3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

/* PAGINATION --------------------------------------------------------- */
.pagination {
    margin-top: 20px;
    text-align: center;
}
.pagination button {
    padding: 10px 18px;
    margin: 0 5px;
    background: #0984e3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.pagination button:hover {
    background: #0c6dc0;
}

/* DETAILS ROW -------------------------------------------------------- */
.details-row {
	display: none; /* required for JS toggle to work */
    background: #f9fbfc;
	transition: all 0.3s ease;
}
.details-content {
    padding: 15px;
    animation: fadeIn 0.3s ease;
}

/* LOGIN INPUTS */
.login-error {
    background: #ffdddd;
    color: #c0392b;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
}
.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;

    display: flex;
    justify-content: center;
    align-items: center;
}
.login-box {
    width: 100%;
    background: #ffffff;
    padding: 40px 35px;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    animation: fadeIn 0.4s ease;
    box-sizing: border-box;
}
.login-box h2 {
    margin: 0 0 25px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2d3436;
    text-align: center;
}
.login-btn {
    width: 100%;
    padding: 14px;
    background: #0984e3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s;
    margin-top: 10px;
}
.login-btn:hover {
    background: #0c6dc0;
}

/* DASHBOARD CARDS --------------------------------------------------- */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 25px;
}
.card {
    background: white;
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: 0.25s;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #636e72;
}
.card-value {
    font-size: 26px;
    font-weight: 700;
    margin-top: 10px;
    color: #2d3436;
}


/* PREMIUM TABLE ----------------------------------------------------- */
#ordersTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 14px; 
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
#ordersTable thead {
    background: #5d5b8c;
}
#ordersTable th {
    padding: 14px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#ordersTable td {
    padding: 14px;
    font-size: 12px;
    border-bottom: 1px solid #ecf0f1;
}
#ordersTable tr:hover td {
    background: #f8f9fa;
}

#formationsTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 14px; 
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
#formationsTable thead {
    background: #5d5b8c;
}
#formationsTable th {
    padding: 14px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#formationsTable td {
    padding: 14px;
    font-size: 12px;
    border-bottom: 1px solid #ecf0f1;
}
#formationsTable tr:hover td {
    background: #f8f9fa;
}
#formationsTable button.join-btn {
    background: #0984e3;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}
#formationsTable button.join-btn:hover {
    background: #065fa8;
}

#pageInfo {
    font-weight: 600;
    margin: 0 10px;
}

/* PERSONAL DATA ----------------------------------------------------- */
#personal p {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 15px;
    font-size: 16px;
}
#personal strong {
    color: #0984e3;
    font-weight: 600;
}

/* DASHBOARD DATA ----------------------------------------------------- */
#dashboard-loader {
    width: 60px;
    height: 60px;
    border: 6px solid #dfe6e9;
    border-top-color: #0984e3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}


.toggle-btn {
    font-size: 18px;
    color: #0984e3;
    cursor: pointer;
    border: none;
    background: none;
}

/* SIDEBAR MENU ------------------------------------------------------ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 230px;
    height: 100vh;
    background: #0984e3;
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.15);
}
.sidebar a {
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    transition: 0.2s;
}
.sidebar a:hover {
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
}
.content {
    margin-left: 260px; /* space for sidebar */
    padding: 30px;
}

/* NAVIGATION BAR ---------------------------------------------------- */
.nav {
    background: #0984e3;
    padding: 15px 25px;

    display: flex;
    justify-content: center;   /* centers the menu */
    align-items: center;
    gap: 35px;                 /* spacing between menu items */

    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: 0.2s;
}
.nav a:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}
.nav a.active {
    border-bottom: 2px solid white;
    padding-bottom: 3px;
}

/* FILTERS ---------------------------------------------------- */
.order-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}
.order-filters input,
.order-filters select {
    padding: 10px 14px;
    border: 1px solid #dcdde1;
    border-radius: 8px;
    font-size: 14px;
    width: 250px;
}
.order-filters button {
    padding: 10px 18px;
    background: #0984e3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.order-filters button:hover {
    background: #0c6dc0;
}

.formation-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}
.formation-filters input,
.formation-filters select {
    padding: 10px 14px;
    border: 1px solid #dcdde1;
    border-radius: 8px;
    font-size: 14px;
    width: 250px;
}
.formation-filters button {
    padding: 10px 18px;
    background: #0984e3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.formation-filters button:hover {
    background: #0c6dc0;
}

.loader {
    width: 60px;
    height: 60px;
    border: 6px solid #dfe6e9;
    border-top-color: #0984e3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* RESPONSIVE -------------------------------------------------------- */
@media (max-width: 900px) {
    .content {
        padding: 20px;
    }

    #docTable th, #docTable td {
        padding: 10px;
        font-size: 13px;
    }
}
@media (max-width: 700px) {
    .nav {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 500px) {
    .card {
        padding: 20px;
    }

    #personal p {
        font-size: 14px;
    }

    .pagination button {
        padding: 8px 12px;
    }
}

/* ANIMATIONS --------------------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
	from { opacity: 0; transform: translateY(-5px); }
	to   { opacity: 1; transform: translateY(0); }
}
