/* Exact Roundcube Webmail CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, sans-serif;
    font-size: 11px;
    background: #f9f9f9;
    color: #333;
    overflow: hidden;
}

/* Top Header */
.roundcube-header {
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
    border-bottom: 1px solid #ccc;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.roundcube-logo {
    font-weight: bold;
    font-size: 12px;
    color: #333;
}

.roundcube-user {
    font-size: 11px;
    color: #666;
}

.roundcube-user a {
    color: #333;
    text-decoration: none;
    margin-left: 10px;
    padding: 2px 6px;
    border: 1px solid #ccc;
    background: #f0f0f0;
    border-radius: 2px;
}

/* Main Layout */
.roundcube-main {
    display: flex;
    height: calc(100vh - 35px);
    margin-top: 35px;
}

/* Left Sidebar */
.roundcube-sidebar {
    width: 200px;
    background: #f0f0f0;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
}

.roundcube-folders {
    flex: 1;
    overflow-y: auto;
}

.folder-item {
    padding: 4px 12px;
    cursor: pointer;
    font-size: 11px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.folder-item:hover {
    background: #e8e8e8;
}

.folder-item.active {
    background: #d1e7fd;
    font-weight: bold;
}

.folder-item .icon {
    width: 16px;
    height: 16px;
    background-size: contain;
}

/* Content Area */
.roundcube-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Toolbar */
.roundcube-toolbar {
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
    border-bottom: 1px solid #ccc;
    padding: 4px 8px;
    display: flex;
    gap: 4px;
    align-items: center;
    height: 32px;
}

.toolbar-btn {
    padding: 3px 8px;
    font-size: 11px;
    border: 1px solid #ccc;
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
    cursor: pointer;
    border-radius: 2px;
    color: #333;
    height: 22px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-btn:hover {
    background: linear-gradient(to bottom, #e8e8e8 0%, #d8d8d8 100%);
}

.toolbar-btn.compose {
    background: linear-gradient(to bottom, #4a90e2 0%, #357abd 100%);
    color: white;
    border-color: #357abd;
}

/* Email List and Preview Layout */
.roundcube-mailview {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.roundcube-maillist {
    width: 50%;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    background: white;
}

.roundcube-preview {
    width: 50%;
    display: flex;
    flex-direction: column;
    background: white;
}

/* Email List */
.maillist-header {
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    height: 24px;
    display: flex;
    align-items: center;
}

.maillist-content {
    flex: 1;
    overflow-y: auto;
}

.mail-item {
    padding: 3px 8px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 20px;
}

.mail-item:hover {
    background: #f0f8ff;
}

.mail-item.selected {
    background: #d1e7fd;
}

.mail-item.unread {
    font-weight: bold;
}

.mail-checkbox {
    width: 12px;
    height: 12px;
}

.mail-subject {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.mail-from {
    width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #666;
}

.mail-date {
    width: 60px;
    color: #666;
    font-size: 10px;
    text-align: right;
}

/* Email Preview */
.preview-header {
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
    padding: 8px;
    font-size: 11px;
}

.preview-subject {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 12px;
}

.preview-meta {
    color: #666;
    font-size: 10px;
}

.preview-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 11px;
    line-height: 1.4;
    font-family: monospace;
}

/* Compose Window */


.compose-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px;
}

.compose-field {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    border-bottom: 1px solid #f0f0f0;
    padding: 2px 0;
}

.compose-label {
    width: 80px;
    font-size: 11px;
    font-weight: bold;
    text-align: right;
    padding-right: 8px;
    color: #333;
}

.compose-input {
    flex: 1;
    border: none;
    font-size: 11px;
    padding: 2px;
    background: transparent;
}

.compose-input:focus {
    outline: none;
    background: #f0f8ff;
}

.compose-message {
    flex: 1;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
}

.compose-textarea {
    flex: 1;
    border: 1px solid #ccc;
    font-size: 12px;
    font-family: Arial, sans-serif;
    padding: 12px;
    resize: none;
    min-height: 200px;
    line-height: 1.4;
}

.compose-actions {
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
}

.compose-btn {
    padding: 4px 12px;
    font-size: 11px;
    border: 1px solid #ccc;
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
    cursor: pointer;
    border-radius: 2px;
}

.compose-btn.send {
    background: linear-gradient(to bottom, #4a90e2 0%, #357abd 100%);
    color: white;
    border-color: #357abd;
}

/* Attachment Area */
.attachment-area {
    border: 1px dashed #ccc;
    padding: 8px;
    margin: 8px 0;
    text-align: center;
    color: #666;
    font-size: 10px;
}

.attachment-list {
    margin-top: 4px;
}

.attachment-item {
    display: inline-block;
    background: #f0f0f0;
    padding: 2px 6px;
    margin: 2px;
    border-radius: 2px;
    font-size: 10px;
}

/* Login Page */
.login-page {
    background: #f0f0f0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 20px;
    width: 300px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.login-logo {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 11px;
    color: #666;
}

.login-form .form-group {
    margin-bottom: 12px;
}

.login-form label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
}

.login-form input, .login-form select {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    font-size: 11px;
    border-radius: 2px;
}

.login-form input:focus, .login-form select:focus {
    outline: none;
    border-color: #4a90e2;
}

.login-btn {
    width: 100%;
    padding: 6px;
    background: linear-gradient(to bottom, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 2px;
}

.error-msg {
    background: #ffe6e6;
    color: #cc0000;
    padding: 6px;
    border: 1px solid #ffcccc;
    border-radius: 2px;
    margin-bottom: 12px;
    font-size: 11px;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Status Messages */
.status-bar {
    background: #ffffcc;
    border: 1px solid #ffcc00;
    padding: 4px 8px;
    font-size: 11px;
    position: fixed;
    top: 35px;
    left: 0;
    right: 0;
    z-index: 1001;
    display: none;
}

/* Responsive adjustments */
@media (max-width: 800px) {
    .roundcube-maillist {
        width: 100%;
    }
    
    .roundcube-preview {
        display: none;
    }
    
    .roundcube-preview.show-mobile {
        display: flex;
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
    }
}