* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo i {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 50%;
}

.logo h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.logo p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
}

/* Navigation */
.nav-tabs {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 5px;
    padding: 10px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.tab-btn.active {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* Main Content */
.main {
    padding: 20px 0 40px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards */
.card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.card-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 25px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-header i {
    font-size: 1.5rem;
    color: #2563eb;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    padding: 30px;
}

.stat-card {
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.stat-card.blue {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.stat-card.green {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

.stat-card.purple {
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
}

.stat-card.orange {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
}

.stat-icon {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 5px;
}

.stat-info p {
    color: #6b7280;
    font-weight: 500;
}

/* Cycle Information */
.cycle-info-section {
    padding: 30px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-top: 1px solid #e5e7eb;
}

.cycle-info-section h3 {
    margin-bottom: 20px;
    color: #1f2937;
    font-weight: bold;
    text-align: center;
}

.cycle-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.cycle-stat {
    background: white;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.cycle-stat i {
    font-size: 1.5rem;
    color: #0ea5e9;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cycle-number, .month-number, .total-months {
    font-size: 1.8rem;
    font-weight: bold;
    color: #0ea5e9;
    display: block;
}

.cycle-stat p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Progress Section */
.progress-section {
    padding: 30px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-top: 1px solid #e5e7eb;
}

.progress-section h3 {
    margin-bottom: 15px;
    color: #1f2937;
    font-weight: bold;
}

.progress-bar {
    background: #e5e7eb;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-section p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Members Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    padding: 30px;
}

.member-card {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border: 2px solid #e5e7eb;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
}

.member-card:hover {
    border-color: #2563eb;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.member-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.member-info h3 {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 8px;
}

.member-status {
    background: #dcfce7;
    color: #166534;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.member-contribution {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.member-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6b7280;
    font-size: 0.9rem;
}

.member-detail i {
    width: 16px;
    color: #2563eb;
}

/* Forms */
.member-form, .email-settings-form {
    padding: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

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

.form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-group input, .winner-select {
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.form-group input:focus, .winner-select:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
}

.btn-draw {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 1.2rem;
    padding: 20px 40px;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.btn-draw:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(245, 158, 11, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Winner Draw */
.draw-card {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
}

.draw-content {
    padding: 40px;
}

.cycle-info {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1f2937;
    text-align: center;
    margin-bottom: 15px;
}

.eligible-count {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #1f2937;
    text-align: center;
}

.eligible-count span {
    font-size: 2rem;
    font-weight: bold;
    color: #2563eb;
}

.draw-description {
    color: #6b7280;
    margin-bottom: 30px;
    text-align: center;
}

/* Manual Winner Selection */
.manual-winner-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid #e5e7eb;
}

.manual-winner-section h3 {
    color: #1f2937;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.manual-winner-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.winner-select {
    flex: 1;
    min-width: 200px;
}

/* Random Draw Section */
.random-draw-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    border: 2px solid #e5e7eb;
}

.random-draw-section h3 {
    color: #1f2937;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.winner-result {
    margin-top: 30px;
}

.winner-card {
    background: white;
    border: 3px solid #f59e0b;
    border-radius: 20px;
    padding: 30px;
    animation: pulse 2s infinite;
    text-align: center;
}

.winner-card i {
    font-size: 3rem;
    color: #f59e0b;
    margin-bottom: 15px;
}

.winner-card h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 15px;
}

.winner-name {
    font-size: 2rem;
    font-weight: bold;
    color: #f59e0b;
    margin-bottom: 15px;
}

.winner-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #10b981;
    margin-bottom: 10px;
}

.winner-cycle-month {
    color: #2563eb;
    font-weight: bold;
    margin-bottom: 10px;
}

.winner-date {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.winner-actions {
    margin-top: 20px;
}

/* Winner History */
.winners-list {
    padding: 30px;
}

.cycle-group {
    margin-bottom: 40px;
}

.cycle-header {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.cycle-winners {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.winner-history-item {
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    border: 2px solid #e9d5ff;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.winner-history-item:hover {
    border-color: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.1);
}

.winner-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.winner-icon {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.winner-info h3 {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 8px;
}

.winner-meta {
    display: flex;
    gap: 20px;
    align-items: center;
}

.winner-date-info {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6b7280;
    font-size: 0.9rem;
}

.winner-round {
    background: #7c3aed;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.winner-right {
    text-align: right;
}

.winner-prize {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #10b981;
    margin-bottom: 5px;
}

.winner-label {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: #2563eb;
    margin-bottom: 20px;
}

.loading-spinner p {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 30px 0;
    text-align: center;
    color: #6b7280;
    margin-top: 50px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .stats-grid, .cycle-stats {
        grid-template-columns: 1fr;
    }
    
    .members-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .winner-history-item {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }

    .manual-winner-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .winner-select {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .card {
        border-radius: 15px;
    }
    
    .card-header {
        padding: 20px;
    }
    
    .stats-grid,
    .members-grid,
    .member-form,
    .email-settings-form,
    .draw-content,
    .winners-list {
        padding: 20px;
    }

    .cycle-info-section {
        padding: 20px;
    }
}