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

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --bg: #f9fafb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    color: var(--text);
}

/* Layout */
.page {
    display: none;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Auth Pages */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-card h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.auth-card .logo {
    display: inline-block;
    font-size: 2.2rem;
    margin-right: 8px;
    animation: fadeIn 0.5s ease-in;
}

.auth-card .subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--bg);
}

.error-message {
    display: none;
    background: #fee;
    border: 2px solid var(--error);
    color: var(--error);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard-header {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--text);
}

.user-info p {
    color: var(--text-light);
}

.credit-display {
    text-align: right;
}

.credit-amount {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.credit-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.nav-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

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

.dashboard-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dashboard-card h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover {
    background: var(--bg);
}

.credit-positive {
    color: var(--success);
    font-weight: 600;
}

.credit-negative {
    color: var(--error);
    font-weight: 600;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.btn-download, .btn-refresh {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-download {
    background: var(--success);
    color: white;
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-refresh {
    background: var(--info);
    color: white;
}

.btn-refresh:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Upload Page */
.upload-container {
    max-width: 600px;
    margin: 0 auto;
}

.upload-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.upload-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text);
}

.upload-card .subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed var(--primary);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--secondary);
    background: var(--bg);
}

.upload-area.dragging {
    border-color: var(--secondary);
    background: #f0f4ff;
    transform: scale(1.02);
}

.upload-area svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: var(--primary);
}

.upload-area h3 {
    margin-bottom: 8px;
    color: var(--text);
}

.upload-area p {
    color: var(--text-light);
    font-size: 0.9rem;
}

#upload-progress {
    display: none;
    text-align: center;
    padding: 20px;
    color: var(--primary);
}

/* Purchase Page */
.purchase-container {
    max-width: 900px;
    margin: 0 auto;
}

.purchase-header {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.purchase-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.current-balance {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.current-balance strong {
    color: var(--primary);
    font-size: 1.5rem;
}

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

.pricing-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.pricing-card.featured {
    border: 3px solid var(--primary);
}

.pricing-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    height: 24px;
}

.pricing-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text);
}

.pricing-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.pricing-credits {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.pricing-price {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.pricing-per-credit {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
    flex-grow: 1;
}

.pricing-card .btn {
    width: 100%;
    margin-top: auto;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background: var(--success);
    color: white;
}

.notification-error {
    background: var(--error);
    color: white;
}

.notification-info {
    background: var(--info);
    color: white;
}

.notification-warning {
    background: var(--warning);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }

    .credit-display {
        text-align: center;
        margin-top: 20px;
    }

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

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