/* 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;
    color: #202124;
    background-color: #ffffff;
    overflow: hidden;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    outline: none;
}

input {
    border: none;
    outline: none;
    font-family: inherit;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 0 16px;
    border-bottom: 1px solid #dadce0;
    background-color: #ffffff;
    position: relative;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 280px;
}

.menu-btn {
    padding: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.menu-btn:hover {
    background-color: #f1f3f4;
}

.logo img {
    height: 40px;
    margin-left: 8px;
}

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

.search-box {
    display: flex;
    align-items: center;
    background-color: #f1f3f4;
    border-radius: 24px;
    padding: 0 16px;
    height: 48px;
    width: 100%;
    max-width: 720px;
}

.search-box:hover {
    background-color: #e8f0fe;
    box-shadow: 0 1px 6px rgba(32,33,36,.28);
}

.search-box:focus-within {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(32,33,36,.28);
}

.search-icon {
    color: #5f6368;
    margin-right: 12px;
}

.search-box input {
    flex: 1;
    background: transparent;
    font-size: 16px;
    color: #202124;
}

.search-box input::placeholder {
    color: #5f6368;
}

.filter-icon {
    color: #5f6368;
    margin-left: 12px;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 280px;
    justify-content: flex-end;
}

.icon-btn {
    padding: 12px;
    border-radius: 50%;
    color: #5f6368;
    transition: background-color 0.2s;
}

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

.profile-pic {
    margin-left: 8px;
}

.profile-pic img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 64px);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    border-right: 1px solid #dadce0;
    padding: 16px 0;
    overflow-y: auto;
}

.compose-btn {
    display: flex;
    align-items: center;
    background-color: #c2e7ff;
    border-radius: 24px;
    padding: 12px 24px;
    margin: 0 16px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #001d35;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}

.compose-btn:hover {
    background-color: #a8deff;
    box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
}

.compose-btn .material-icons {
    margin-right: 8px;
    font-size: 24px;
}

.sidebar-nav {
    margin-bottom: 24px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 16px 8px 24px;
    margin: 2px 8px;
    border-radius: 0 16px 16px 0;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #5f6368;
    font-size: 14px;
}

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

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

.nav-item .material-icons {
    margin-right: 12px;
    font-size: 20px;
}

.nav-text {
    flex: 1;
}

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

.storage-info {
    margin: 0 16px;
    font-size: 13px;
    color: #5f6368;
}

.storage-bar {
    height: 4px;
    background-color: #f1f3f4;
    border-radius: 2px;
    margin-top: 8px;
}

.storage-progress {
    height: 100%;
    width: 8%;
    background-color: #4285f4;
    border-radius: 2px;
}

/* Email List */
.email-list {
    flex: 1;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid #dadce0;
    background-color: #ffffff;
    min-height: 48px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.select-all {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.email-count {
    font-size: 13px;
    color: #5f6368;
    margin-right: 16px;
}

/* Email Items */
.email-items {
    flex: 1;
    overflow-y: auto;
}

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

.email-item: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;
}

.email-item.unread {
    background-color: #ffffff;
}

.email-item.unread .sender,
.email-item.unread .subject-text {
    font-weight: 700;
}

.email-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 16px;
    cursor: pointer;
}

.star-btn,
.important-btn {
    padding: 4px;
    margin-right: 8px;
    border-radius: 4px;
    color: #5f6368;
}

.star-btn:hover,
.important-btn:hover {
    color: #fbbc04;
}

.star-btn.starred {
    color: #fbbc04;
}

.important-btn.important {
    color: #fbbc04;
}

.sender {
    width: 200px;
    font-size: 14px;
    margin-right: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.subject-text {
    font-size: 14px;
}

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

.date {
    width: 100px;
    font-size: 13px;
    color: #5f6368;
    text-align: right;
}

/* Right Panel */
.right-panel {
    width: 56px;
    background-color: #ffffff;
    border-left: 1px solid #dadce0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
}

.panel-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 4px 0;
    color: #5f6368;
    transition: background-color 0.2s;
}

.panel-icon:hover {
    background-color: #f1f3f4;
}

.panel-icon.active {
    background-color: #fce8e6;
    color: #d93025;
}

/* Compose Modal */
.compose-modal {
    position: fixed;
    bottom: 0;
    right: 48px;
    width: 500px;
    background-color: #ffffff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12), 0 5px 5px -3px rgba(0,0,0,.2);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.compose-modal.show {
    transform: translateY(0);
}

.compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #f9f9f9;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: #202124;
}

.compose-actions {
    display: flex;
    gap: 4px;
}

.compose-body {
    padding: 0;
}

.compose-field {
    border-bottom: 1px solid #dadce0;
}

.compose-field input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
}

.compose-field input::placeholder {
    color: #5f6368;
}

.compose-editor {
    min-height: 200px;
    padding: 16px;
}

.editor {
    min-height: 150px;
    outline: none;
    font-size: 14px;
    line-height: 1.5;
}

.editor:empty:before {
    content: attr(data-placeholder);
    color: #5f6368;
}

.compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid #dadce0;
}

.send-btn {
    display: flex;
    align-items: center;
    background-color: #1a73e8;
    color: #ffffff;
    padding: 8px 24px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s;
}

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

.send-btn .material-icons {
    margin-left: 8px;
    font-size: 18px;
}

.compose-tools {
    display: flex;
    gap: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .header-left {
        min-width: 240px;
    }
    
    .header-right {
        min-width: 240px;
    }
    
    .compose-modal {
        right: 16px;
        width: 400px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 64px;
    }
    
    .sidebar .nav-text,
    .sidebar .count {
        display: none;
    }
    
    .compose-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
        margin: 0 4px 16px;
    }
    
    .compose-btn span:last-child {
        display: none;
    }
    
    .storage-info {
        display: none;
    }
    
    .header-left,
    .header-right {
        min-width: auto;
    }
    
    .sender {
        width: 120px;
    }
    
    .compose-modal {
        right: 8px;
        width: calc(100% - 16px);
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .email-count {
        display: none;
    }
    
    .toolbar-right .icon-btn:not(:last-child):not(:nth-last-child(2)) {
        display: none;
    }
    
    .right-panel {
        display: none;
    }
    
    .sender {
        width: 80px;
    }
    
    .date {
        width: 60px;
        font-size: 12px;
    }
}
