/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #202124;
    background-color: #fff;
}

.hidden {
    display: none !important;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: #1a73e8;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.logo p {
    color: #5f6368;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #3c4043;
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #3c4043;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
}

.login-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background: #1557b0;
}

.error-message {
    color: #d93025;
    font-size: 12px;
    margin-top: 8px;
    padding: 8px;
    background: #fce8e6;
    border-radius: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Main Email Interface */
.email-interface {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    height: 64px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
}

.header-center {
    flex: 1;
    max-width: 700px;
    margin: 0 auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.logo-small {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-small .material-icons {
    color: #1a73e8;
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 500;
    color: #202124;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f1f3f4;
    border-radius: 8px;
    padding: 8px 16px;
    max-width: 500px;
    margin: 0 auto;
}

.search-box .material-icons {
    color: #5f6368;
    margin-right: 12px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 14px;
}

.icon-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background: #f1f3f4;
}

.icon-btn .material-icons {
    font-size: 20px;
    color: #5f6368;
}

/* Main Container */
.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 256px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px 0;
    flex-shrink: 0;
}

.compose-btn {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 24px;
    padding: 12px 24px;
    margin: 0 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: box-shadow 0.2s, background-color 0.2s;
    width: calc(100% - 32px);
}

.compose-btn:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

.compose-btn .material-icons {
    font-size: 20px;
    color: #ea4335;
}

.nav-list {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 0 20px 20px 0;
    margin-right: 8px;
}

.nav-item:hover {
    background: #f1f3f4;
}

.nav-item.active {
    background: #fce8e6;
    color: #d93025;
    font-weight: 500;
}

.nav-item .material-icons {
    font-size: 20px;
    color: #5f6368;
}

.nav-item.active .material-icons {
    color: #d93025;
}

/* Email List Container */
.email-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.email-list-header {
    height: 48px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.email-list {
    flex: 1;
    overflow-y: auto;
}

.no-emails {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #5f6368;
}

.no-emails .material-icons {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-emails h3 {
    margin-bottom: 8px;
    font-weight: 400;
}

.email-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.email-item:hover {
    background: #f5f5f5;
}

.email-item.unread {
    background: #f8f9fa;
    font-weight: 500;
}

.email-checkbox {
    margin-right: 12px;
}

.email-sender {
    width: 200px;
    flex-shrink: 0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-subject {
    flex: 1;
    margin-right: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-date {
    color: #5f6368;
    font-size: 12px;
    flex-shrink: 0;
}

/* Email Panel */
.email-panel {
    width: 0;
    background: white;
    border-left: 1px solid #e0e0e0;
    transition: width 0.3s ease;
    overflow: hidden;
}

.email-panel.show {
    width: 600px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 500;
}

.compose-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.form-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.form-row label {
    width: 80px;
    flex-shrink: 0;
    font-weight: 500;
    padding-top: 8px;
}

.form-row input,
.form-row textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.form-row textarea {
    resize: vertical;
    min-height: 300px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
    margin-top: 16px;
}

.send-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background: #1557b0;
}

.send-btn:disabled {
    background: #f1f3f4;
    color: #5f6368;
    cursor: not-allowed;
}

.draft-btn {
    background: none;
    color: #5f6368;
    border: 1px solid #dadce0;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.draft-btn:hover {
    background: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -256px;
        top: 64px;
        height: calc(100vh - 64px);
        z-index: 200;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .email-list-container {
        margin-left: 0;
    }
    
    .header-center {
        display: none;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* Loading and Status Indicators */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #5f6368;
}

.status-message {
    padding: 12px 16px;
    margin: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.status-message.success {
    background: #e8f5e8;
    color: #137333;
    border: 1px solid #ceead6;
}

.status-message.error {
    background: #fce8e6;
    color: #d93025;
    border: 1px solid #fad2cf;
}

.status-message.info {
    background: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #d2e3fc;
}