/* PROYECTO: Google Clone (Vibecoding Edition)
   DESARROLLADOR: juan esteban
*/

/* --- 1. RESET GLOBAL Y BODY --- */
* {
    box-sizing: border-box;
}

body {
    background-color: #202124;
    color: #bdc1c6;
    font-family: 'Google Sans', arial, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Evita scroll doble */
}

/* --- 2. CABECERA (HEADER) --- */
header {
    height: 60px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 16px;
}

.nav-right {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-right li {
    margin-left: 8px;
}

.nav-right a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    padding: 8px;
}

.nav-right a:hover {
    text-decoration: underline;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #e8eaed;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover {
    background-color: rgba(232, 234, 237, 0.08);
}

.profile-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.profile-icon:hover {
    background-color: rgba(232, 234, 237, 0.08);
}

/* --- 3. MENÚS DESPLEGABLES (APPS Y PERFIL) --- */
.apps-dropdown, .profile-dropdown {
    position: absolute;
    top: 64px;
    background-color: #2d2e30;
    border-radius: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 16px 24px rgba(0,0,0,0.2);
    z-index: 2000;
    display: none; /* Se activa con la clase .show */
    flex-direction: column;
}

.apps-dropdown.show, .profile-dropdown.show {
    display: flex;
}

/* Ajustes específicos de Apps */
.apps-dropdown {
    right: 16px;
    width: 330px;
    max-height: 450px;
    padding: 16px;
}

.apps-scroll-container {
    overflow-y: auto;
    padding-right: 4px;
}

/* Scrollbar estilo Google Dark */
.apps-scroll-container::-webkit-scrollbar {
    width: 8px;
}
.apps-scroll-container::-webkit-scrollbar-thumb {
    background: #5f6368;
    border-radius: 10px;
    border: 2px solid #2d2e30;
}

/* --- 4. DISEÑO DE GRILLA DE APPS --- */
.favorites-section {
    background-color: #1f1f1f;
    border-radius: 24px;
    padding: 12px;
    margin-bottom: 8px;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px;
    color: #e8eaed;
    font-size: 14px;
}

.edit-btn {
    background: #3c4043;
    border: none;
    color: #bdc1c6;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.app-item:hover {
    background-color: rgba(232, 234, 237, 0.08);
}

.app-item img {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

.app-item span {
    font-size: 12px;
    color: #e8eaed;
    text-align: center;
}

.more-from-google {
    background: transparent;
    border: 1px solid #5f6368;
    color: #8ab4f8;
    padding: 10px;
    border-radius: 20px;
    width: 100%;
    margin-top: 16px;
    cursor: pointer;
}

/* --- 5. DISEÑO DE PERFIL (CORREGIDO) --- */
.profile-dropdown {
    right: 8px;
    width: 360px;
    padding: 16px;
}

.profile-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-bottom: 16px;
}

.user-email {
    font-size: 14px;
    color: #e8eaed;
}

.close-btn {
    position: absolute;
    right: 0;
    background: transparent;
    border: none;
    color: #bdc1c6;
    cursor: pointer;
}

.profile-main {
    text-align: center;
    padding: 8px 0;
}

.profile-pic-large {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
}

.profile-pic-large img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.camera-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #3c4043;
    border: 2px solid #2d2e30;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.profile-main h2 {
    color: #e8eaed;
    font-size: 20px;
    margin: 0 0 12px;
    font-weight: 400;
}

.manage-acc-btn {
    border: 1px solid #5f6368;
    padding: 10px 24px;
    border-radius: 100px;
    text-decoration: none;
    color: #8ab4f8;
    font-size: 14px;
    display: inline-block;
}

/* CORRECCIÓN DE LA IMAGEN QUE ROMPÍA TODO */
.mini-pic {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #5f6368;
}

/* El botón de "Mostrar más cuentas" */
.show-accounts {
    background: #1f1f1f; /* Fondo oscuro */
    border: none;
    width: 100%;
    padding: 8px 16px;
    border-radius: 20px; /* Bordes redondeados de Google */
    color: #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    cursor: pointer;
}

/* Las demás opciones del menú */
.menu-item {
    background: #1f1f1f;
    margin-bottom: 4px; /* Separación mínima entre bloques */
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e8eaed;
    cursor: pointer;
}

.menu-item:hover {
    background: #2d2e30;
}

/* --- 6. CONTENIDO CENTRAL --- */
main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: -60px;
}

.logo img {
    width: 272px;
    margin-bottom: 24px;
}

.search-wrapper {
    width: 100%;
    max-width: 584px;
    padding: 0 20px;
}

.search-bar {
    background: #202124;
    border: 1px solid #5f6368;
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 44px;
}

.search-bar:hover {
    background: #303134;
    box-shadow: 0 1px 6px rgba(0,0,0,0.28);
    border-color: rgba(223,225,229,0);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e8eaed;
    font-size: 16px;
    outline: none;
    padding: 0 10px;
}

.ai-mode-btn {
    background: #3c4043;
    border: none;
    color: #e8eaed;
    padding: 6px 12px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.button-group {
    margin-top: 28px;
}

.google-btn {
    background-color: #303134;
    border: 1px solid #303134;
    color: #e8eaed;
    padding: 0 16px;
    height: 36px;
    border-radius: 4px;
    margin: 5px;
    cursor: pointer;
}

.google-btn:hover {
    border: 1px solid #5f6368;
}

/* --- 7. FOOTER --- */
footer {
    background: #171717;
    font-size: 14px;
}

.footer-row {
    padding: 15px 30px;
    border-top: 1px solid #3c4043;
}

.bottom-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-links a {
    color: #999da2;
    text-decoration: none;
    margin-right: 24px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* --- ICONOS --- */
.material-symbols-outlined {
    font-size: 22px;
}

.search-tools {
    display: flex;
    align-items: center;
    gap: 12px; /* Espacio entre micrófono, cámara y botón AI */
    padding-right: 8px;
}

.tool-icon {
    color: #bdc1c6;
    cursor: pointer;
    font-size: 20px;
}

.tool-icon:hover {
    color: #e8eaed;
}

.ai-mode-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #303134;
    border: 1px solid #5f6368;
    border-radius: 18px;
    padding: 5px 12px;
    color: #e8eaed;
    cursor: pointer;
    font-size: 13px;
}

.apps-dropdown.show, .profile-dropdown.show {
    display: flex !important; /* El !important asegura que gane al display: none */
}

.menu-footer {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.footer-btn {
    flex: 1; /* Hace que ambos midan lo mismo */
    background: #1f1f1f;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #e8eaed;
    font-size: 13px;
    cursor: pointer;
}