/* --- 1. GLOBAL RESET & FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    z-index: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f4f7f6;
    color: #333;
    min-height: 100vh;
}

/* --- 2. NAVBAR --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: white;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 12;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4285F4;
    display: flex;
    justify-content: center;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.guest-badge {
    background: #e8f0fe;
    color: #1967d2;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-primary {
    background: #333;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #555;
}

.logo>img{
    width: 50px;
    height: 47px;
}

#user-pic {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
}

/* --- 3. HERO & SEARCH SECTION --- */
.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    text-align: center;
}

.hero-text h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.highlight {
    color: #EA4335;
    /* Google Red */
    position: relative;
    display: inline-block;
    z-index: -1;
}

.highlight::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 10px;
    bottom: 5px;
    left: 0;
    background: rgba(234, 67, 53, 0.2);
    z-index: -1;
}

/* SEARCH BAR DESIGN */
.search-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
    position: relative;
    /* z-index: inherit; */
}

.search-bar {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s;
}

.search-bar:focus-within {
    border-color: #4285F4;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    padding: 0 15px;
    font-size: 1.1rem;
}

.search-icon {
    color: #888;
}

.tune-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: 1.2rem;
    padding: 5px;
    transition: transform 0.2s;
}

.tune-icon:hover {
    color: #4285F4;
}

.go-btn {
    background: #4285F4;
    color: white;
    border: none;
    padding: 0 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 600;
}

.go-btn:hover {
    background: #3367d6;
}

/* CHIPS */
.quick-chips {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    background: white;
    border: 1px solid #ddd;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: #e8f0fe;
    border-color: #4285F4;
    color: #1967d2;
}

/* --- 4. SETTINGS PANEL (POPUP) --- */
.hidden {
    display: none !important;
}

.settings-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    text-align: left;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

#close-panel {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.setting-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

select {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* TOGGLE SWITCH */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e68a1a;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #4285F4;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* --- 5. OUTPUT CARDS (THE MAIN FEATURE) --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 5px solid #ccc;
    /* Default Border */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #444;
}

.card p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
}

/* SPECIFIC CARD COLORS */
.card-blue {
    border-left-color: #4285F4;
    background: #f8fbff;
}

.card-blue h3 {
    color: #1967d2;
}

.card-yellow {
    border-left-color: #FBBC05;
    background: #fffbf0;
}

.card-yellow h3 {
    color: #d99a00;
}

.card-green {
    border-left-color: #34A853;
    background: #f1f9f3;
}

.card-green h3 {
    color: #1e8e3e;
}

.card-purple {
    border-left-color: #A142F4;
    background: #f8f1ff;
}

.card-purple h3 {
    color: #8430ce;
}

.card-orange {
    border-left-color: #FF7817;
    background: #fff5eb;
}

.card-red {
    border-left-color: #EA4335;
    background: #fef2f1;
}

/* LOADING SPINNER */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4285F4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .search-wrapper {
        flex-direction: column;
    }

    .go-btn {
        width: 100%;
        margin-top: 10px;
    }
}



#app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 9999;
    /* Sabse upar rahega */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
    /* Smooth fade out */
}

.loader-content {
    text-align: center;
}

.loader-content h2 {
    color: #4285F4;
    margin-top: 20px;
    font-size: 1.5rem;
}

.loader-content p {
    color: #666;
    font-size: 0.9rem;
}


/* Adding profile menu styling */
/* --- 7. PROFILE DROPDOWN MENU UI --- */

/* The Dropdown Container */
.profile-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 250px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
    transform-origin: top right;
    z-index: 1200;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Section 1: Header (Read Only) */
.dropdown-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.user-name {
    font-weight: 700;
    color: #333;
    font-size: 1rem;
    /* margin-bottom: 4px; */
    display: none;
}

.user-stat {
    font-size: 0.8rem;
    color: #666;
    background: #e8f0fe;
    padding: 2px 8px;
    border-radius: 10px;
    color: #1967d2;
}

/* Section 2: Menu Items */
.dropdown-menu {
    list-style: none;
    padding: 5px 0;
}

.menu-item {
    padding: 10px 20px;
    font-size: 0.95rem;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.menu-item:hover {
    background-color: #f1f3f4;
    color: #4285F4;
}

.menu-item i {
    width: 20px;
    text-align: center;
    color: #888;
}

.menu-item:hover i {
    color: #4285F4;
}

/* Section 3: Logout (Red Hover) */
.logout-item:hover {
    background-color: #fce8e6;
    /* Light Red bg */
    color: #d93025;
    /* Google Red text */
}

.logout-item:hover i {
    color: #d93025;
}

/* Divider Lines */
.divider {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 0;
}

/* Helper to show pointer on profile pic */
.profile-trigger {
    cursor: pointer;
    transition: transform 0.2s;
}

.profile-trigger:hover {
    transform: scale(1.1);
    border-color: #4285F4;
}

/* --- 8. SEARCH LOADING ANIMATION (Fix) --- */

/* Ye container hai jo cards ke upar dikhega */
#loading {
    display: none;
    /* By default chupa rahega */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px auto;
    text-align: center;
    gap: 15px;
}

/* Ye ghumne wala circle hai */
#loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    /* Light Grey background */
    border-top: 4px solid #4285F4;
    /* Blue active color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    /* Center align */
}

/* "Soch raha hu..." text ka style */
#loading p {
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    animation: pulse 1.5s infinite ease-in-out;
}

/* Animations */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}





/* Universal Pop up  */
/* --- UNIALERT (Custom Popup) --- */
.uni-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Dark dim background */
    backdrop-filter: blur(5px);
    /* Blur Effect */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    /* Sabse upar */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.uni-alert-overlay.active {
    opacity: 1;
    visibility: visible;
}

.uni-alert-box {
    background: white;
    width: 90%;
    max-width: 400px;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy effect */
}

.uni-alert-overlay.active .uni-alert-box {
    transform: scale(1);
}

.uni-alert-msg {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.5;
    font-weight: 500;
}

.uni-alert-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.uni-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    font-weight: 500;
}

.uni-btn-primary {
    background: #4285F4;
    color: white;
}

.uni-btn-primary:hover {
    background: #3367d6;
}

.uni-btn-secondary {
    background: #f1f3f4;
    color: #555;
}

.uni-btn-secondary:hover {
    background: #e0e0e0;
}

/* About App Button Style */
#nav-about-btn, #nav-about-btn-mob {
    background-color: transparent;
    border: 1px solid #dadce0;
    color: #5f6368;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
}

/* Hover Effect */
#nav-about-btn:hover, #nav-about-btn-mob:hover {
    background-color: #f1f3f4;
    color: #202124;
    border-color: #c0c2c5;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
}

/* Active/Click Effect */
#nav-about-btn:active, #nav-about-btn-mob:active {
    background-color: #e8eaed;
    transform: scale(0.98);
}

/* About app popup styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    padding: 25px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-height: 85vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

.intro-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 5px solid #4285F4;
    margin-bottom: 20px;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    margin-bottom: 10px;
    color: #555;
}

.hidden {
    display: none !important;
}

#mobMenuWin {
    transition: 1s;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: absolute;
    background-color: rgb(255, 255, 255);
    top: 4rem;
    z-index: 100;
    height: 0rem;
    padding: 0 0;
    overflow: hidden;
}

#nav-about-btn-mob {
    margin-right: 0 !important;
}

.mobMenuItems {
    margin: 0 10px;
}

#nav-expand-btn {
    /* padding: 5px 10px; */
    background-color: transparent;
    outline: none;
    border: none;
    display: none;
    height: 30px;
    border-radius: 3px;
    width: 30px;
    position: absolute;
    right: 20px;
    transform: rotate(0deg);
    z-index: 8;
    zoom: 120%;
    /* transition-duration: 1s; */
}

#nav-expand-btn:active {
    background-color: var(--teal-text-color);
}

#nav-expand-btn>div {
    transition-duration: 1s;
    background-color: rgb(0, 0, 0);
    width: 70%;
    height: 3px;
    margin: 3px auto;
    position: absolute;
    opacity: 1;
}

#nav-expand-btn>div:nth-child(1) {
    top: 4px;
    left: 4px;
}

#nav-expand-btn>div:nth-child(2) {
    top: 10.5px;
    transition-duration: 0.5s;
    left: 4px;
}

#nav-expand-btn>div:nth-child(3) {
    bottom: 4px;
    left: 4px;
}

#dropdown-name {
    margin-left: auto !important;
    margin-right: 10px;
}

/* --- Achievement Section Styles --- */
.achievement-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Image Wrapper and Hint Styles */
.cert-image-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.achievement-cert {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #ddd;
    display: block;
    object-fit: contain;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

/* Hover effect jisse user ko pata chale ki ye clickable hai */
.achievement-cert:hover {
    opacity: 0.85;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.image-hint {
    font-size: 0.75rem;
    color: #888;
    margin-top: 6px;
    text-align: center;
}

.achievement-details {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.achievement-details p {
    margin: 0;
    line-height: 1.5;
}

.achievement-subtext {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin-top: 12px !important;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #FBBC04;
}

/* Responsive layout for desktop */
@media (min-width: 600px) {
    .achievement-card {
        flex-direction: row;
        text-align: left;
    }
    
    .achievement-details {
        text-align: left;
    }
    
    .cert-image-wrapper {
        width: 100%;
        margin: 0;
    }
}


/* Make it responsive design  */
/* For Tablet */
@media (min-width: 770px) and (max-width: 4023px) {
    #mobMenuWin {
        height: 0 !important;
    }
}

/* For Mobile  */
@media screen and (max-width: 770px) {
    .navbar {
        padding: 1rem 0;

    }

    .logo {
        font-size: 19px;
        padding-left: 1rem;
    }

    .logo>img {
        width: 40px;
        height: 37px;
    }

    #nav-about-btn {
        margin-right: 0 !important;
    }

}

/* Misc */
@media screen and (max-width: 637px) {
    #nav-about-btn {
        font-size: 12px;
    }

    .to-be-hidden {
        display: none !important;
    }

    #nav-expand-btn {
        display: block;
    }

    .about-section span {
        font-size: 14px;
    }

    .modal-content h2 {
        font-size: 21px;
    }

    .about-card h3 {
        font-size: 20px;
    }

    .about-card p {
        font-size: 14px;
    }


}

@media screen and (max-width: 600px) {
    #search-btn {
        padding: 0.5rem;
    }

    #user-info {
        transform: translateY(-12px) translateX(-15px);
    }

    #dropdown-name {
        font-size: 14px;
        position: absolute;
        right: 10px;
        bottom: 8px;
        margin-left: 0;
        margin-right: 0;
    }

    #topicInput {
        font-size: 15px;
    }

}