/* =========================
   GLOBAL
========================= */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #eef4fa;
    color: #1f2937;
}

/* =========================
   PAGE BACKGROUND
========================= */
.homepage-bg {
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #dbe8f5 0%, #c7d9eb 100%);
    display: flex;
    flex-direction: column;
}

.homepage-bg .container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* =========================
   USER DETAIL SECTION
========================= */
.user-detail-holder {
    position: relative;
    display: flex;
    flex-direction: row;
    width: 100%;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
    padding: 10px 10px 0 10px;
    overflow: hidden;
    margin-bottom: 30px;
}

.user-img-holder {
    height: 60px;
    width: 60px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.user-img-holder img {
    width: 100%;
    height: 100%;
    object-position: top;
    object-fit: cover;
    border-radius: 12px;
}

.user-data-holder {
    min-height: 60px;
    display: flex;
    gap: 12px;
    width: auto;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: width 0.4s ease;
}

.user-data-holder p {
    margin-bottom: 6px;
    font-size: 14px;
}

#userName {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

#userEmail {
    font-size: 14px;
    color: #4b5563;
}

.arrow-btn {
    position: relative;
    display: flex;
    height: 60px;
    width: 40px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.4s ease, background 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.arrow-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

.arrow-btn i {
    font-size: 24px;
    color: #1f2937;
}

.rotate {
    transform: rotate(180deg);
}

.user-hidden-data {
    display: flex;
    gap: 16px;
    width: 100%;
    overflow: hidden;
    transition: width 0.4s ease;
    align-items: flex-start;
}

.user-data-hidden {
    width: 0;
    height: auto;
}

div p {
    margin-bottom: 7px;
}

#editBtn,
#logoutBtn {
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 10px;
    font-weight: 600;
}

#editBtn {
    margin-top: 4px !important;
}

/* =========================
   MAIN MODULE CARD AREA
========================= */
.three-btn-holder {
    flex: 1; /* takes remaining space */
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 320px));
    gap: 30px;

    justify-content: center; /* center horizontally */
    align-content: center;   /* ✅ center vertically */

    width: 100%;
}

.three-btn-holder a {
    width: 100%;
    text-decoration: none;
}

.three-btn-holder a .button-div {
    display: flex;
    flex-direction: column;
    justify-content: center;   /* ✅ vertical center */
    align-items: center;       /* ✅ horizontal center */
    text-align: center;        /* ✅ center text */
    min-height: 260px;
    width: 100%;
    padding: 28px 20px;
    border-radius: 22px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    color: #111827;
    box-shadow: 0 10px 30px rgba(31, 41, 55, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.55);
    transition: all 0.25s ease;
}

.three-btn-holder a .button-div:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(31, 41, 55, 0.16);
    background: rgba(255, 255, 255, 0.96);
}

.three-btn-holder a .button-div::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 120px;
    height: 120px;
    background: rgba(37, 99, 235, 0.06);
    border-radius: 50%;
}

/* =========================
   ICON CARD CONTENT
========================= */
.module-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: linear-gradient(135deg, #e8f0ff, #dbeafe);
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 18px;
}

.module-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}
.module-subtitle {
    font-size: 14px;
    color: #6b7280;
    max-width: 85%;
}

/* =========================
   OPTIONAL LEGACY IMAGE RULE
   (kept harmless if any old img remains)
========================= */
.button-div img {
    display: none;
    width: 100%;
    height: 35%;
    object-fit: cover;
}

/* =========================
   GENERIC BUTTONS
========================= */
.btn {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

/* =========================
   FILE / GRID LEGACY BLOCKS
========================= */
.file-list {
    margin-top: 20px;
}

.file-list ul {
    list-style-type: none;
    padding: 0;
}

.file-list li {
    padding: 5px 0;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.grid-item {
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.grid-item a {
    text-decoration: none;
    color: #007bff;
}

.grid-item a:hover {
    text-decoration: underline;
}

/* =========================
   LOGIN / SIGNUP BUTTONS
========================= */
.two-btn-holder {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 120px;
    gap: 30px;
}

.two-btn-holder a {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: calc((100% - 30px) / 2);
    height: 90px;
    text-decoration: none;
}

.two-btn-holder a .signup-login-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: bold;
    color: white;
    width: 100%;
    height: 100%;
    background-color: rgba(48, 83, 126, 0.75);
    border-radius: 16px;
    margin: 0;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.18);
    transition: all 0.3s ease-in-out;
}

a .signup-login-btn:hover {
    background: rgba(255, 255, 255, 0.75);
    transform: translateY(-4px);
    box-shadow: 0px 14px 28px rgba(33, 33, 33, 0.15);
    color: black;
}

/* =========================
   TABLET
========================= */
@media screen and (max-width: 1199px) {
    .three-btn-holder {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }

    .module-title {
        font-size: 24px;
    }
}

/* =========================
   MOBILE / PORTRAIT
========================= */
@media screen and (max-width: 767px), screen and (orientation: portrait) {
    .homepage-bg {
        min-height: 100vh;
        padding: 15px 0 30px 0;
    }

    .three-btn-holder {
        grid-template-columns: 1fr;
        align-content: start; /* don't force vertical center on mobile */
        padding-top: 20px;
    }

    .three-btn-holder a {
        width: 100%;
    }

    .three-btn-holder a .button-div {
        min-height: 220px;
        padding: 24px 20px;
        border-radius: 18px;
    }

    .module-icon {
        width: 60px;
        height: 60px;
        font-size: 26px;
        border-radius: 16px;
        margin-bottom: 18px;
    }

    .module-title {
        font-size: 22px;
    }

    .module-subtitle {
        font-size: 14px;
    }

    .user-detail-holder {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        gap: 10px;
    }

    .arrow-btn {
        width: 100%;
        height: 48px;
    }

    .user-data-holder {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        padding: 14px;
    }

    #expandedUserDetails {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: fit-content;
    }

    .user-hidden-data {
        flex-direction: column;
        height: auto;
        width: 100%;
        transition: height 0.4s ease;
    }

    .user-data-hidden {
        height: 0 !important;
        width: 100%;
        transition: height 0.4s ease;
    }

    .two-btn-holder {
        flex-direction: column;
        gap: 16px;
    }

    .two-btn-holder a {
        width: 100%;
    }
}