@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --accent-primary: #06b6d4;
    --accent-secondary: #0891b2;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #475569;
    --border-light: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --gradient-success: linear-gradient(135deg, var(--accent-success), #059669);
    --gradient-warning: linear-gradient(135deg, var(--accent-warning), #d97706);
    --gradient-danger: linear-gradient(135deg, var(--accent-danger), #dc2626);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(at 40% 20%, hsla(228, 34%, 14%, 0.7) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189, 36%, 14%, 0.5) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(355, 24%, 14%, 0.3) 0px, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header Styles */
.header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    font-weight: 800;
}

.user-info {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info b {
    color: var(--text-primary);
}

.user-info #user-budget {
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Card Styles */
.wrapper, .auctioneer-panel, .auction-area, .login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.wrapper::before, .auctioneer-panel::before, .auction-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
    opacity: 0.6;
}

.wrapper:hover, .auctioneer-panel:hover, .auction-area:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
    transform: translateY(-1px);
}

.form-control:hover {
    border-color: var(--border-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    position: relative;
    overflow: hidden;
    min-height: 2.5rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-warning {
    background: var(--gradient-warning);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Timer Styles */
#timer {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    text-align: center;
    margin-bottom: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
}

#timer.warning {
    background: var(--gradient-warning);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 1s infinite;
}

#timer.danger {
    background: var(--gradient-danger);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shake 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Player Info Styles */
#current-player-info {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
}

#current-player-info h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#current-player-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Bidding Info */
#bidding-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

#bidding-info p {
    background: rgba(30, 41, 59, 0.5);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
    text-align: center;
}

#current-bid {
    color: var(--accent-success);
    font-weight: 700;
    font-size: 1.2rem;
}

#current-bidder {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Bidding Form */
.bidding-form {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.bidding-form .form-control {
    flex: 1;
    min-width: 0;
}

/* Messages */
.message {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border-color: var(--accent-success);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}

.message.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
    border-color: var(--accent-warning);
}

.message.info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Tables */
.report-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-top: 1.5rem;
}

.report-table th {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-table td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.report-table tr {
    background: var(--bg-secondary);
}

.report-table tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.7);
}

.report-table tr:hover {
    background: rgba(51, 65, 85, 0.8);
}

/* Auctioneer Panel */
.auctioneer-panel {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(51, 65, 85, 0.8));
}

.auctioneer-panel h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.manual-player-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.auction-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .auction-area, .wrapper, .auctioneer-panel {
        padding: 1.5rem;
    }
    
    .bidding-form {
        flex-direction: column;
    }
    
    .manual-player-form {
        grid-template-columns: 1fr;
    }
    
    .auction-controls {
        flex-direction: column;
    }
    
    .nav {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Help Block */
.help-block {
    color: var(--accent-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.has-error .form-control {
    border-color: var(--accent-danger);
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.hidden { display: none; }
.opacity-50 { opacity: 0.5; }

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-active {
    background: var(--accent-success);
    animation: pulse 2s infinite;
}

.status-inactive {
    background: var(--text-muted);
}

/* Login Page Specific Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.75rem;
    font-weight: 700;
}

.login-card p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-card .btn {
    width: 100%;
    margin-top: 1rem;
}

.login-card .form-group:last-of-type {
    margin-bottom: 0;
}