/* assets/css/style.css */

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --danger: #d93025;
    --success: #1e8e3e;
    --warning: #f9ab00;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e8eaed;
    --gray-300: #dadce0;
    --gray-500: #5f6368;
    --gray-700: #3c4043;
    --gray-900: #202124;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    --radius: 8px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    padding: 10px 0;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--gray-900);
    text-decoration: none;
}

.logo i {
    color: var(--primary);
    margin-right: 10px;
    font-size: 28px;
}

.header-search {
    flex: 1;
    max-width: 700px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: 24px;
    padding: 0 16px;
    transition: background 0.2s, box-shadow 0.2s;
}

.search-input-wrapper:focus-within {
    background: var(--white);
    box-shadow: var(--shadow);
}

.search-input-wrapper i {
    color: var(--gray-500);
    margin-right: 12px;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 0;
    font-size: 16px;
    outline: none;
}

.search-input-wrapper button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    transition: background 0.2s;
}

.main-nav a:hover {
    background: var(--gray-100);
}

.main-nav a.active {
    color: var(--primary);
    background: #e8f0fe;
}

.main-nav a i {
    margin-right: 8px;
}

.btn-donate {
    background: var(--danger) !important;
    color: var(--white) !important;
}

.btn-donate:hover {
    background: #c5221f !important;
}

/* Gmail-style Document List */
.documents-layout {
    display: flex;
    gap: 24px;
    padding: 24px 0;
}

.filters-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.filters-sidebar h3 {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group label {
    display: block;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-weight: 500;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
}

.documents-main {
    flex: 1;
    min-width: 0;
}

.documents-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--gray-50);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--gray-200);
}

.document-list.gmail-style {
    background: var(--white);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
}

.document-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-200);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
}

.document-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1;
    position: relative;
}

.doc-checkbox,
.doc-star {
    padding: 8px;
    cursor: pointer;
}

.doc-star i {
    color: var(--gray-300);
    transition: color 0.2s;
}

.doc-star:hover i,
.doc-star.starred i {
    color: var(--warning);
}

.doc-sender {
    width: 180px;
    font-weight: 500;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-content {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0 12px;
}

.doc-subject {
    font-weight: 500;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-separator {
    color: var(--gray-300);
    margin: 0 8px;
}

.doc-snippet {
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.doc-date {
    color: var(--gray-500);
    font-size: 13px;
    white-space: nowrap;
}

/* Document View */
.document-view {
    padding: 24px 0;
}

.document-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-link {
    display: flex;
    align-items: center;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
}

.back-link i {
    margin-right: 8px;
}

.document-layout {
    display: flex;
    gap: 24px;
}

.document-main {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.email-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.email-subject {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.sender-info {
    display: flex;
    align-items: flex-start;
}

.sender-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 16px;
}

.sender-name {
    font-weight: 500;
}

.sender-email {
    color: var(--gray-500);
    font-weight: 400;
}

.view-toggle {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
}

.toggle-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--gray-500);
    font-weight: 500;
    transition: color 0.2s;
}

.toggle-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.document-content {
    padding: 24px;
}

.email-body {
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.8;
    color: var(--gray-700);
}

.document-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.sidebar-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.sidebar-section h4 {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.sidebar-section h4 i {
    margin-right: 8px;
    color: var(--gray-500);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--gray-100);
}

/* Search Results */
.search-result-item {
    background: var(--white);
    padding: 20px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.search-result-item:hover {
    box-shadow: var(--shadow-lg);
}

.result-title {
    font-size: 18px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.result-title:hover {
    text-decoration: underline;
}

.result-meta {
    display: flex;
    gap: 16px;
    margin: 8px 0;
    font-size: 13px;
    color: var(--gray-500);
}

.result-snippet {
    color: var(--gray-700);
    font-size: 14px;
}

.result-snippet mark {
    background: #fff59d;
    padding: 0 2px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 24px;
}

.page-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: var(--white);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    box-shadow: var(--shadow);
}

/* Donation Page */
.donate-page {
    padding: 40px 0;
}

.donate-header {
    text-align: center;
    margin-bottom: 40px;
}

.donate-header h1 {
    font-size: 32px;
    margin-bottom: 12px;
}

.donate-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

.donate-form {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.amount-btn {
    padding: 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.amount-btn:hover,
.amount-btn.active {
    border-color: var(--primary);
    background: #e8f0fe;
    color: var(--primary);
}

.card-input {
    padding: 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 16px;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: var(--gray-300);
    text-decoration: none;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--gray-700);
    font-size: 14px;
    color: var(--gray-500);
}

/* Responsive */
@media (max-width: 1024px) {
    .documents-layout {
        flex-direction: column;
    }
    
    .filters-sidebar {
        width: 100%;
    }
    
    .document-layout {
        flex-direction: column;
    }
    
    .document-sidebar {
        width: 100%;
    }
    
    .donate-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-search {
        display: none;
    }
    
    .main-nav {
        display: none;
    }
    
    .doc-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}