@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,wght@6..144,1..1000&display=swap');

/* Page Visibility */
.page {
    display: none;
    height: 100%;
    width: 100%;
}

.page.active {
    display: block;
}

#login-page.active, #email-page.active, #password-page.active {
    display: flex;
}

/* Login Page Styles */
#login-page, #email-page, #password-page {
    background-color: #f0f4f8;
    align-items: center;
    justify-content: center;
    font-family: 'Google Sans Flex', sans-serif;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1040px;
    min-height: 100vh;
    justify-content: center;
}

.login-card {
    background-color: #fff;
    border-radius: 28px;
    padding: 48px 40px 36px;
    width: 100%;
    max-width: 448px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #e7eaed;
}

@media (max-width: 600px) {
    .login-card {
        max-width: 100%;
        border-radius: 0;
        border: none;
        background-color: transparent;
    }
    #login-page {
        background-color: #fff;
    }
}

.login-logo {
    margin-bottom: 16px;
}

.login-title {
    color: #1f1f1f;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.3333;
    margin-bottom: 12px;
    padding-bottom: 0;
    padding-top: 16px;
    text-align: center;
}

.login-subtitle {
    font-size: 16px;
    color: #1f1f1f;
    margin-bottom: 40px;
    text-align: center;
}

.login-text-content {
    font-size: 14px;
    color: #444746;
    margin-bottom: 40px;
    line-height: 1.5;
    width: 100%;
}

.login-text-content a {
    color: #0b57d0;
    text-decoration: none;
    font-weight: 500;
}

.email-selector {
    border: 1px solid #747775;
    border-radius: 18px;
    padding: 4px 12px 4px 8px;
    display: flex;
    align-items: center;
    height: 36px;
    margin-bottom: 40px;
    cursor: pointer;
    color: #1f1f1f;
    font-size: 14px;
    font-weight: 500;
}

.email-selector:hover {
    background-color: rgba(60,64,67,0.08);
}

.profile-icon-small {
    margin-right: 8px;
    display: flex;
    align-items: center;
    color: #444746;
}

.selected-email {
    margin-right: 8px;
}

.chevron-icon {
    color: #444746;
}

/* Floating Label Input */
.input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 6px;
}

.login-input {
    width: 100%;
    height: 56px;
    padding: 13px 15px;
    border: 1px solid #747775;
    border-radius: 4px;
    font-size: 16px;
    color: #1f1f1f;
    background-color: transparent;
    outline: none;
    transition: border-color 0.2s;
    z-index: 1;
}

.login-input:focus {
    border-color: #0b57d0;
    border-width: 2px;
    padding: 12px 14px; /* Adjust for border width */
}

.login-label {
    position: absolute;
    left: 12px;
    top: 16px;
    padding: 0 4px;
    background-color: #fff;
    color: #444746;
    font-size: 16px;
    transition: 0.2s ease all;
    pointer-events: none;
}

.login-input:focus ~ .login-label,
.login-input:not(:placeholder-shown) ~ .login-label {
    top: -8px;
    font-size: 12px;
    color: #0b57d0;
    font-weight: 500;
}

.login-input:not(:focus):not(:placeholder-shown) ~ .login-label {
    color: #444746;
}

.checkbox-container {
    width: 100%;
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    padding-left: 2px;
}

.checkbox-container input {
    margin-right: 16px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0b57d0;
}

.checkbox-container label {
    font-size: 14px;
    color: #1f1f1f;
    cursor: pointer;
}

.login-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.forgot-link {
    color: #0b57d0;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 4px;
    padding: 6px 8px;
}

.forgot-link:hover {
    background-color: #f0f4f8;
}

.create-account-btn {
    color: #0b57d0;
    background: none;
    border: none;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 8px 8px 0;
    border-radius: 4px;
}

.create-account-btn:hover {
    background-color: #f0f4f8;
}

.next-btn {
    background-color: #0b57d0;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0 24px;
    height: 40px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.next-btn:hover {
    background-color: #0b57d0;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.login-footer {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 448px;
    margin-top: 24px;
    font-size: 12px;
    color: #444746;
}

.lang-select {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}

.lang-select:hover {
    background-color: rgba(60,64,67,0.08);
}

.lang-select svg {
    margin-left: 16px;
}

.footer-links {
    display: flex;
    align-items: center;
}

.footer-links a {
    color: #444746;
    text-decoration: none;
    margin-left: 16px;
    padding: 6px 8px;
    border-radius: 4px;
}

.footer-links a:hover {
    background-color: rgba(60,64,67,0.08);
}

/* Existing Styles */
:root {
    --bg-color: #f6f8fc;
    --sidebar-width: 256px;
    --primary-text: #1f1f1f;
    --secondary-text: #444746;
    --active-nav-bg: #d3e3fd;
    --active-nav-text: #001d35;
    --compose-bg: #c2e7ff;
    --compose-hover: #b3d7ef;
    --compose-text: #001d35;
    --search-bg: #eaf1fb;
    --border-color: #e7eaed;
    --hover-bg: #f2f2f2;
    --unread-bg: #ffffff;
    --read-bg: #f2f6fc; /* Actually Gmail uses white for both usually, but bold for unread. Let's stick to white. */
    --tab-active-color: #0b57d0;
    --tab-hover-bg: #f2f2f2;
}

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

body {
    font-family: 'Google Sans Flex', Roboto, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text);
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
}

.wrapper {
    display: flex;
    height: 100%;
}

/* Sidebar */
.navigation-sidebar {
    width: var(--sidebar-width);
    padding: 8px;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    flex-shrink: 0;
}

.cm-logo {
    height: 30px;
    width: auto;
    margin: 8px 0 30px 16px;
    align-self: flex-start;
}

.compose-button {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--compose-bg);
    color: var(--compose-text);
    padding: 0 24px 0 16px;
    height: 56px;
    min-width: 96px;
    width: fit-content;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    margin: 8px 0 16px 8px;
    transition: box-shadow 0.08s linear, min-width 0.15s cubic-bezier(0.4,0.0,0.2,1);
}

.compose-button:hover {
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    background-color: var(--compose-hover);
}

.nav-links {
    list-style: none;
    padding-right: 8px;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 0 12px 0 26px;
    height: 32px;
    text-decoration: none;
    color: var(--primary-text);
    border-radius: 0 16px 16px 0;
    font-size: 14px;
}

.nav-item.active a {
    background-color: var(--active-nav-bg);
    color: var(--active-nav-text);
    font-weight: 700;
}

.nav-item a:hover:not(.active a) {
    background-color: rgba(31,31,31,0.06);
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 18px;
    fill: currentColor;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-text {
    flex-grow: 1;
}

.nav-badge {
    font-size: 12px;
    font-weight: 500;
}

/* Main Area */
.main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 16px;
    margin: 8px 8px 8px 0;
    overflow: hidden;
}

/* Header */
.header {
    padding: 8px;
    display: flex;
    align-items: center;
}

.search-bar-container {
    background-color: var(--search-bg);
    border-radius: 24px;
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    max-width: 720px;
    width: 100%;
    margin-left: 8px;
    transition: background 100ms ease-in,width 100ms ease-out;
}

.search-bar-container:focus-within {
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 2px 6px 2px rgba(60,64,67,0.15);
}

.search-btn, .search-options-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text);
}

.search-btn:hover, .search-options-btn:hover {
    background-color: rgba(60,64,67,0.08);
    color: var(--primary-text);
}

.search-bar {
    border: none;
    background: none;
    flex-grow: 1;
    height: 100%;
    padding: 0 8px;
    font-size: 16px;
    font-family: inherit;
    color: var(--primary-text);
    outline: none;
}

/* Inbox */
.inbox {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
}

.tab {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    color: var(--secondary-text);
    position: relative;
    min-width: 200px; /* Approximate */
    max-width: 250px;
    flex: 1;
}

.tab:hover {
    background-color: var(--tab-hover-bg);
    color: var(--primary-text);
}

.tab.active {
    color: var(--tab-active-color);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 8px;
    right: 8px;
    height: 3px;
    background-color: var(--tab-active-color);
    border-radius: 3px 3px 0 0;
}

.tab-icon {
    margin-right: 16px;
    display: flex;
    align-items: center;
}

.tab-icon svg {
    fill: currentColor;
}

.tab-text {
    font-weight: 500;
    font-size: 14px;
}

.tab-badge {
    background-color: #1e8e3e;
    color: white;
    font-size: 12px;
    padding: 0 6px;
    border-radius: 10px;
    margin-left: 8px;
    height: 16px;
    line-height: 16px;
}

/* Email List */
.inbox-main {
    flex-grow: 1;
    overflow-y: auto;
}

.email-list {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.msg {
    height: 40px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.05); /* Very subtle divider */
    background-color: #fff;
}

.msg:hover {
    box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    z-index: 1;
    position: relative;
}

.msg.unread {
    background-color: #fff;
    font-weight: 700;
}

.msg.unread .msg-content .subject,
.msg.unread .msg-from,
.msg.unread .msg-date {
    font-weight: 700;
    color: var(--primary-text);
}

.msg-select {
    width: 50px;
    padding-left: 16px;
    vertical-align: middle;
}

.checkbox-wrapper {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    border: 2px solid #757575; /* Simplified checkbox */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.3;
}

.checkbox-wrapper:hover {
    opacity: 1;
    border-color: #444;
}

.checkbox-icon {
    display: none; /* Hide checkmark for unchecked */
    width: 16px;
    height: 16px;
    fill: #fff;
}

.msg:hover .checkbox-wrapper {
    opacity: 0.6;
}

.msg-star {
    width: 40px;
    padding-left: 0;
    vertical-align: middle;
}

.i-star {
    width: 20px;
    height: 20px;
    stroke: #444746;
    fill: none;
    cursor: pointer;
}

.i-star:hover {
    stroke: #1f1f1f;
}

.msg-from {
    width: 168px;
    padding-right: 32px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    color: var(--primary-text);
    vertical-align: middle;
}

.msg-content {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    font-weight: 400;
    color: var(--secondary-text);
}

.msg-content .subject {
    color: var(--primary-text);
}

.msg-content .preview {
    color: var(--secondary-text);
    font-weight: 400;
}

.msg-date {
    width: 100px;
    text-align: right;
    padding-right: 16px;
    font-size: 12px;
    color: var(--primary-text);
    vertical-align: middle;
    font-weight: 500;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #dadce0;
    border: 4px solid transparent;
    background-clip: content-box;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #bdc1c6;
}

