/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(30, 30, 60, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #00ff88, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.2em;
    color: #b0b0b0;
    margin-bottom: 20px;
}

/* Connection Status */
.connection-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.wallet-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.9em;
}

.wallet-info span {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    font-family: monospace;
    color: #00ff88;
}

/* Cards */
.card {
    background: rgba(30, 30, 60, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #e0e0e0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #b0b0b0;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.2);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(45deg, #00d4ff, #0088ff);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #868e96);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: white;
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #20c997);
    color: white;
}

.btn-warning {
    background: linear-gradient(45deg, #ff9800, #ffb74d);
    color: white;
}

.btn-danger {
    background: linear-gradient(45deg, #f44336, #ef5350);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Period Status */
.period-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-item label {
    font-weight: 600;
    color: #b0b0b0;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.settlement {
    background: #fff3cd;
    color: #856404;
}

/* Statistics */
.stats-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.stats-section h3 {
    margin-bottom: 15px;
    color: #b0b0b0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.stat-item label {
    font-weight: 600;
    color: #b0b0b0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.stat-card h3 {
    font-size: 1em;
    color: #b0b0b0;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #00ff88;
    display: block;
}

/* Transaction Status */
.transaction-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 212, 255, 0.95);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.transaction-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Messages */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(244, 67, 54, 0.95);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2em;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .period-status {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .connection-status {
        flex-direction: column;
        gap: 10px;
    }

    .error-message {
        max-width: 95%;
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.5em;
    }
}