* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1a202c;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1E40AF, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.8rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
}

.nav-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.nav-btn.active {
    background: linear-gradient(135deg, #1E40AF, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.nav-btn.recipient-only {
    display: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.welcome-text {
    font-size: 0.9rem;
    color: #1f2937;
    font-weight: 500;
}

.user-role {
    font-size: 0.8rem;
    color: #059669;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-info {
    text-align: right;
}

.balance-label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
}

.balance-amount {
    font-size: 1.2rem;
    font-weight: 600;
    color: #059669;
}

.logout-btn {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Login Styles */
.login-container {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 2rem;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 100%;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1E40AF, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #6b7280;
    font-size: 1rem;
}

.role-selection h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    text-align: center;
}

.role-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.role-option {
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.role-option:hover {
    border-color: #1E40AF;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.15);
}

.role-option.selected {
    border-color: #059669;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(5, 150, 105, 0.05));
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.2);
}

.role-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.role-option h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.role-option p {
    color: #6b7280;
    font-size: 0.9rem;
}

.login-form {
    animation: fadeIn 0.5s ease;
}

.selected-role {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: #1f2937;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.login-footer p {
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.login-footer small {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E40AF, #059669);
    border-radius: 1rem;
    color: white;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #6b7280;
    font-weight: 500;
}

/* Dashboard Content */
.dashboard-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.donation-history, .impact-tracker {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.donation-history h3, .impact-tracker h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
}

/* Organizations Grid */
.organizations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.org-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.org-card:hover {
    transform: translateY(-5px);
    border-color: #1E40AF;
}

.org-card.selected {
    border-color: #059669;
    box-shadow: 0 15px 40px rgba(5, 150, 105, 0.3);
}

.org-image {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.org-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.org-info p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.org-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.org-stats span {
    font-size: 0.9rem;
    color: #059669;
    font-weight: 500;
}

/* Forms */
.donation-form, .update-form {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.donation-form h3, .update-form h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #1E40AF;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.selected-org {
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #1f2937;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #1E40AF, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
}

.btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Ledger */
.ledger-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-group select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    font-size: 1rem;
}

.transaction-list {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.transaction-item {
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.3s ease;
}

.transaction-item:hover {
    background: #f9fafb;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    flex: 1;
}

.transaction-info h4 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.transaction-info p {
    color: #6b7280;
    font-size: 0.9rem;
}

.transaction-meta {
    text-align: right;
}

.transaction-amount {
    font-size: 1.2rem;
    font-weight: 600;
    color: #059669;
    margin-bottom: 0.25rem;
}

.transaction-time {
    font-size: 0.8rem;
    color: #9ca3af;
}

.transaction-id {
    font-size: 0.8rem;
    color: #6b7280;
    font-family: monospace;
}

/* History Items */
.history-item, .impact-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.history-item h4, .impact-item h4 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.history-item p, .impact-item p {
    color: #6b7280;
    font-size: 0.9rem;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.history-amount {
    font-weight: 600;
    color: #059669;
}

.history-date {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Recipient Portal */
.org-selector {
    margin-bottom: 2rem;
}

.org-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: white;
}

.org-selector select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.recipient-content {
    max-width: 800px;
    margin: 0 auto;
}

.recent-updates {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.recent-updates h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.transaction-progress {
    margin-bottom: 2rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.completed {
    opacity: 1;
    color: #059669;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.progress-step.active .step-number {
    background: #1E40AF;
    color: white;
}

.progress-step.completed .step-number {
    background: #059669;
    color: white;
}

.transaction-details {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-right {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .welcome-message {
        align-items: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .organizations-grid {
        grid-template-columns: 1fr;
    }

    .ledger-filters {
        flex-direction: column;
    }

    .container {
        padding: 0 1rem;
    }

    .page-header h2 {
        font-size: 2rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .transaction-meta {
        text-align: left;
        width: 100%;
    }

    .login-card {
        padding: 2rem;
        margin: 1rem;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .role-options {
        grid-template-columns: 1fr;
    }
}