* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #202124;
    color: #202124;
    overflow: hidden;
    height: 100vh;
}

.browser-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Browser Top Bar */
.browser-topbar {
    display: flex;
    align-items: center;
    height: 40px;
    background: #E8EAED;
    border-bottom: 1px solid #DADCE0;
    padding: 0 8px;
    -webkit-app-region: drag;
}

.browser-controls {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.control-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    -webkit-app-region: no-drag;
}

.control-btn.close {
    background: #FF5F57;
}

.control-btn.minimize {
    background: #FFBD2E;
}

.control-btn.maximize {
    background: #28CA42;
}

.browser-tabs {
    flex: 1;

    /* Highlight sender details on hover of the email-content area */
    .email-content:hover .sender-details,
    .email-from-info:hover .sender-details {
        background: rgba(26,115,232,0.03);
        border-radius: 6px;
        padding: 6px;
    }
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #E8EAED;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 13px;
    color: #3C4043;
    white-space: nowrap;
    -webkit-app-region: no-drag;
    border: 1px solid transparent;
    border-bottom: none;
}

.tab.active {
    background: #fff;
    border-color: #DADCE0;
    color: #202124;
}

.tab-icon {
    width: 16px;
    height: 16px;
    color: #5F6368;
}

.tab-close {
    margin-left: 4px;
    font-size: 18px;
    opacity: 0.7;
    padding: 0 4px;
}

.browser-menu {
    -webkit-app-region: no-drag;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #3C4043;
    cursor: pointer;
    padding: 4px 8px;
}

/* Browser Address Bar */
.browser-address-bar {
    display: flex;
    align-items: center;
    height: 56px;
    background: #E8EAED;
    padding: 0 16px;
    gap: 12px;
    border-bottom: 1px solid #DADCE0;
}

.nav-buttons {
    display: flex;
    gap: 4px;
}

.nav-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3C4043;
    font-size: 16px;
}

.nav-btn:hover:not(:disabled) {
    background: #DADCE0;
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.address-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #DADCE0;
    border-radius: 24px;
    padding: 8px 16px;
    height: 40px;
}

.lock-icon {
    width: 16px;
    height: 16px;
    color: #5F6368;
    flex-shrink: 0;
}

.address-text {
    flex: 1;
    font-size: 14px;
    color: #3C4043;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.star-icon {
    width: 16px;
    height: 16px;
    color: #5F6368;
    flex-shrink: 0;
    opacity: 0.6;
}

.browser-actions {
    display: flex;
    gap: 4px;
}

.action-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3C4043;
    font-size: 18px;
}

.action-btn:hover {
    background: #DADCE0;
}

/* Gmail Container */
.gmail-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}

/* Gmail Header */
.gmail-header {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 8px 24px;
    background: #fff;
    border-bottom: 1px solid rgba(60, 64, 67, 0.12);
    gap: 16px;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.15);
}

.gmail-logo-section {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 240px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: #5F6368;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.15s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: rgba(60, 64, 67, 0.1);
}

.gmail-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 500;
    color: #202124;
    cursor: pointer;
    letter-spacing: -0.5px;
}

.gmail-search {
    flex: 1;
    display: flex;
    align-items: center;
    background: #F1F3F4;
    border-radius: 24px;
    padding: 0 20px;
    height: 48px;
    max-width: 720px;
    gap: 16px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.gmail-search:focus-within {
    background: #fff;
    border-color: rgba(60, 64, 67, 0.2);
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.15);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: #5F6368;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 16px;
    color: #202124;
}

.search-options {
    color: #5F6368;
    cursor: pointer;
    padding: 4px;
}

.gmail-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5F6368;
    transition: background-color 0.15s ease;
}

.header-btn:hover {
    background: rgba(60, 64, 67, 0.1);
}

.profile-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1A73E8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    margin-left: 8px;
    cursor: pointer;
    transition: box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.profile-circle:hover {
    box-shadow: 0 2px 4px rgba(60, 64, 67, 0.4);
}

/* Gmail Content */
.gmail-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Gmail Sidebar */
.gmail-sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid rgba(60, 64, 67, 0.12);
    padding: 8px 4px;
    overflow-y: auto;
}

.compose-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: calc(100% - 8px);
    padding: 12px 24px;
    background: #C2E7FF;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #001D35;
    cursor: pointer;
    margin: 8px 4px 16px 4px;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
    transition: all 0.2s ease;
}

.compose-btn svg {
    width: 20px;
    height: 20px;
}

.compose-btn:hover {
    box-shadow: 0 2px 6px rgba(60, 64, 67, 0.18);
    background: #B8E0FF;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 6px 12px 6px 26px;
    border-radius: 0 25px 25px 0;
    text-decoration: none;
    color: #202124;
    font-size: 14px;
    margin-right: 8px;
    transition: all 0.15s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(60, 64, 67, 0.08);
}

.nav-item.active {
    background: #D3E3FD;
    color: #001D35;
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #1A73E8;
    border-radius: 0 2px 2px 0;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.badge {
    margin-left: auto;
    background: #1A73E8;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    line-height: 16px;
}

/* Email List */
.email-list-container {
    width: 400px;
    background: #fff;
    border-right: 1px solid rgba(60, 64, 67, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.email-list-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(60, 64, 67, 0.12);
    min-height: 48px;
    background: #fff;
}

.select-all,
.refresh-btn,
.more-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5F6368;
}

.select-all:hover,
.refresh-btn:hover,
.more-btn:hover {
    background: #F1F3F4;
}

.email-list {
    flex: 1;
    overflow-y: auto;
}

.email-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(60, 64, 67, 0.08);
    cursor: pointer;
    background: #fff;
    transition: all 0.15s ease;
    position: relative;
}

.email-item:hover {
    background: rgba(60, 64, 67, 0.04);
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.1);
}

.email-item.unread {
    background: #fff;
    font-weight: 500;
}

.email-item.unread .email-from {
    font-weight: 600;
}

.email-item.active {
    background: #E8F0FE;
    border-left: 4px solid #1A73E8;
    box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.1);
}

.email-checkbox,
.email-star {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5F6368;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 4px;
}

.email-item:hover .email-checkbox,
.email-item:hover .email-star,
.email-item.active .email-checkbox,
.email-item.active .email-star {
    opacity: 1;
}

.email-checkbox:hover,
.email-star:hover {
    background: rgba(60, 64, 67, 0.1);
}

.email-star.filled {
    opacity: 1;
    color: #F4B400;
}

.email-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.email-from {
    font-size: 14px;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 20px;
}

.email-subject-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #5F6368;
    white-space: nowrap;
    overflow: hidden;
    line-height: 20px;
}

.email-subject {
    font-weight: 400;
    color: #202124;
}

.email-item.unread .email-subject {
    font-weight: 600;
    color: #202124;
}

.email-preview {
    color: #5F6368;
    font-weight: 400;
}

.email-time {
    font-size: 12px;
    color: #5F6368;
    margin-left: auto;
    white-space: nowrap;
}

.email-attachment {
    color: #5F6368;
    opacity: 0.7;
}

/* Email View */
.email-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow-y: auto;
    position: relative;
}

.email-content-wrapper {
    display: none;
    flex-direction: column;
    height: 100%;
}

.email-content-wrapper.active {
    display: flex;
}

.email-view-header {
    padding: 20px 32px;
    border-bottom: 1px solid rgba(60, 64, 67, 0.12);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

/* Phishing warning styles */
.phishing-warning {
    background: #FFF4F4;
    border: 1px solid #FFD0D0;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.phish-badge {
    display: inline-block;
    background: #D93025;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.phish-indicators {
    margin: 8px 0 0 16px;
    color: #5F6368;
}

/* Suspicious link tooltip */
.suspicious-link {
    position: relative;
}
.suspicious-link::after {
    content: attr(data-real-url);
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    white-space: nowrap;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    pointer-events: none;
}
.suspicious-link:hover::after,
.suspicious-link:focus::after {
    opacity: 1;
    transform: translateY(0);
}
    .verify-btn[data-real-url],
    .suspicious-link,
    .verify-btn.suspicious-link {
        position: relative;
    }
    .verify-btn[data-real-url]::after {
        content: attr(data-real-url);
        position: absolute;
        left: 0;
        top: calc(100% + 6px);
        white-space: nowrap;
        background: rgba(0,0,0,0.85);
        color: #fff;
        padding: 6px 8px;
        border-radius: 6px;
        font-size: 12px;
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity 0.12s ease, transform 0.12s ease;
        pointer-events: none;
        z-index: 30;
    }
    .verify-btn[data-real-url]:hover::after,
    .verify-btn[data-real-url]:focus::after {
        opacity: 1;
        transform: translateY(0);
    }

    /* ensure phishing warning visible space by default but hidden until the email is opened */
    .phishing-warning { display: none; }

.email-view-subject {
    font-size: 20px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 16px;
    line-height: 28px;
    letter-spacing: -0.2px;
}

.email-view-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.email-action-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5F6368;
    transition: background-color 0.15s ease;
}

.email-action-btn:hover {
    background: rgba(60, 64, 67, 0.1);
}

.email-content {
    padding: 24px 32px;
    max-width: 840px;
}

.email-from-info {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.sender-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1A73E8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.email-content-wrapper[data-email-content="github"] .sender-avatar {
    background: #24292e;
}

.email-content-wrapper[data-email-content="linkedin"] .sender-avatar {
    background: #0077b5;
}

.sender-details {
    flex: 1;
}

.sender-name {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 2px;
    line-height: 20px;
}

.sender-email {
    font-size: 12px;
    color: #5F6368;
    margin-bottom: 4px;
}

.email-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #5F6368;
}

.email-date {
    margin-left: auto;
}

.email-body {
    margin-bottom: 24px;
}

.email-body-content {
    font-size: 14px;
    line-height: 1.65;
    color: #202124;
    letter-spacing: 0.01em;
}

.email-body-content p {
    margin-bottom: 16px;
}

.email-body-content ul,
.email-body-content ol {
    margin: 16px 0 16px 24px;
}

.email-body-content li {
    margin-bottom: 8px;
}

.email-cta {
    margin: 24px 0;
}

.verify-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #1A73E8;
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
    border: none;
    cursor: pointer;
}

.verify-btn:hover {
    background: #1765CC;
    box-shadow: 0 2px 6px rgba(60, 64, 67, 0.25);
    transform: translateY(-1px);
}

.email-divider {
    border: none;
    border-top: 1px solid rgba(60, 64, 67, 0.12);
    margin: 32px 0;
}

.email-footer {
    font-size: 12px;
    color: #5F6368;
    line-height: 1.6;
}

.email-reply {
    display: flex;
    gap: 8px;
    padding-top: 24px;
    margin-top: 8px;
    border-top: 1px solid rgba(60, 64, 67, 0.12);
}

.reply-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: none;
    border: 1px solid rgba(60, 64, 67, 0.2);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    cursor: pointer;
    transition: all 0.15s ease;
}

.reply-btn:hover {
    background: rgba(60, 64, 67, 0.08);
    border-color: rgba(60, 64, 67, 0.3);
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.1);
}

.reply-btn svg {
    color: #5F6368;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 16px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 4px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
    background-clip: padding-box;
}

/* Responsive */
@media (max-width: 1200px) {
    .gmail-sidebar {
        width: 200px;
    }
    
    .email-list-container {
        width: 280px;
    }
}
