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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 40px;
}

/* Card Container */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card-icon {
    font-size: 2em;
    margin-bottom: 20px;
    font-weight: bold;
}

.card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.card p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Info Section */
.info-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
}

.info-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.info-section ul {
    list-style: none;
    padding: 0;
}

.info-section li {
    padding: 10px 0;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}

.info-section li:last-child {
    border-bottom: none;
}

/* Form Container */
.form-container {
    max-width: 500px;
    margin: 0 auto;
}

.form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
    font-family: inherit;
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

/* Special styling for select dropdown */
select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px;
}

select.form-control option {
    padding: 10px;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #888;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-accent {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* Result Container */
.result-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.unique-code-box {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 15px;
    margin: 30px 0;
}

.unique-code-box h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.unique-code {
    background: white;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    color: #667eea;
    word-break: break-all;
    border: 2px solid #667eea;
    margin: 20px 0;
    font-weight: bold;
}

.code-tip {
    color: #888;
    font-size: 0.9em;
    margin-top: 15px;
}

.host-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.host-info p {
    color: #555;
    font-size: 1.1em;
}

.host-info span {
    font-weight: bold;
    color: #667eea;
}

/* Summary Section */
.summary-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.summary-section h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
}

.total-income {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
}

.income-amount {
    font-size: 3em;
    font-weight: bold;
}

.income-unit {
    font-size: 1.5em;
}

/* Income List Container */
.income-list-container {
    max-width: 900px;
    margin: 0 auto;
}

.filter-info {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
    color: #333;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.filter-info span {
    font-size: 1em;
}

.filter-info strong {
    color: #667eea;
    font-weight: bold;
}

/* Income Cards */
.income-cards {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.income-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.income-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-title {
    font-size: 0.85em;
    opacity: 0.9;
}

.date-value {
    font-size: 1.3em;
    font-weight: bold;
}

.income-badge {
    background: white;
    color: #667eea;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
}

.card-body {
    padding: 25px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: 600;
    color: #667eea;
}

.info-row .value {
    color: #333;
    font-weight: 500;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
    margin: 20px 0;
}

.section-title {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* Income Grid */
.income-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.income-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.3s;
}

.income-item:hover {
    background: #e9ecef;
}

.item-label {
    font-size: 0.85em;
    color: #666;
}

.item-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

/* Alert Box */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Back Link */
.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.back-link a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Footer */
.footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.9em;
    border-top: 1px solid #e0e0e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }

    .main-content {
        padding: 20px;
    }

    .card-container {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .card-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .income-grid {
        grid-template-columns: 1fr;
    }

    .filter-info {
        flex-direction: column;
        gap: 10px;
    }
}
