/* General Styles */
* {
    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;
}

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

/* Live Score Page */
.live-score-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

.score-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.score-header h1 {
    color: #333;
    font-size: 2em;
}

.live-badge {
    background: #f00;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.match-info {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.team {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.vs {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: bold;
}

.venue {
    text-align: center;
    color: #666;
    font-size: 1.1em;
}

.score-display {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.current-score {
    display: grid;
    gap: 25px;
}

.batting-team {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.batting-team h2 {
    margin-bottom: 15px;
    font-size: 1.8em;
}

.score {
    font-size: 3.5em;
    font-weight: bold;
    margin: 10px 0;
}

.overs, .run-rate {
    font-size: 1.2em;
    margin: 5px 0;
}

.target-info {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.6);
    font-size: 1.1em;
    line-height: 1.6;
}

.batsmen, .bowler-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.batsmen h3, .bowler-info h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.batsman, .bowler {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: white;
    margin: 8px 0;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.batsman .name, .bowler .name {
    font-weight: 600;
    color: #333;
}

.batsman .score, .bowler .figures {
    color: #667eea;
    font-weight: bold;
}

.recent-balls {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.recent-balls h3 {
    margin-bottom: 15px;
    color: #333;
}

.balls-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ball {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e9ecef;
    font-weight: bold;
    color: #333;
    border: 2px solid #dee2e6;
}

.ball.wicket {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.ball.four {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.ball.six {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.no-match {
    background: white;
    padding: 60px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.no-match h2 {
    color: #333;
    margin-bottom: 10px;
}

.no-match p {
    color: #666;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 1.5em;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875em;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
}

/* Admin Page */
.admin-page {
    background: #f4f6f9;
}

.admin-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 70px;
}

.nav-brand a {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    margin-left: 40px;
    flex: 1;
}

.nav-menu > li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-menu a:hover {
    background: #f8f9fa;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 5px;
    min-width: 180px;
    z-index: 1000;
    list-style: none;
    padding: 5px 0;
}

.dropdown-menu li a {
    padding: 10px 20px;
    display: block;
}

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

.admin-page .container {
    padding-top: 30px;
}

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

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.stat-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 1.1em;
}

.stat-card.live .stat-label {
    color: white;
}

.quick-actions, .recent-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.quick-actions h2, .recent-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875em;
    font-weight: 500;
}

.badge-live {
    background: #28a745;
    color: white;
}

.badge-completed {
    background: #6c757d;
    color: white;
}

.badge-not_started {
    background: #ffc107;
    color: #333;
}

/* Scoring Page */
.scoring-container {
    max-width: 1400px;
    margin: 0 auto;
}

.scoring-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin-top: 20px;
}

.scoring-main {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scoring-sidebar {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.score-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 10px;
    color: white;
    text-align: center;
    margin-bottom: 25px;
}

.score-panel h2 {
    margin-bottom: 10px;
}

.score-panel .big-score {
    font-size: 3.5em;
    font-weight: bold;
    margin: 15px 0;
}

.runs-panel {
    margin-bottom: 25px;
}

.runs-panel h3 {
    margin-bottom: 15px;
}

.run-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.run-btn {
    padding: 20px;
    font-size: 1.5em;
    font-weight: bold;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.run-btn:hover {
    background: #667eea;
    color: white;
}

.run-btn:active {
    transform: scale(0.95);
}

.extras-panel, .wicket-panel {
    margin-bottom: 25px;
}

.extras-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.extra-btn, .wicket-btn {
    padding: 15px;
    font-size: 1em;
    border: 2px solid #ffc107;
    background: white;
    color: #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.wicket-btn {
    border-color: #dc3545;
    width: 100%;
    font-size: 1.2em;
    padding: 20px;
}

.extra-btn:hover, .wicket-btn:hover {
    opacity: 0.8;
}

.control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .scoring-grid {
        grid-template-columns: 1fr;
    }
    
    .run-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Modern Dashboard Styles */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-welcome {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

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

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

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

.stat-card-modern {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card-modern.stat-card-purple::before {
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.stat-card-modern.stat-card-blue::before {
    background: linear-gradient(90deg, #2193b0, #6dd5ed);
}

.stat-card-modern.stat-card-green::before {
    background: linear-gradient(90deg, #11998e, #38ef7d);
}

.stat-card-modern.stat-card-red::before {
    background: linear-gradient(90deg, #eb3349, #f45c43);
}

.stat-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-card-modern .stat-icon {
    font-size: 2.5em;
}

.stat-trend {
    font-size: 0.85em;
    font-weight: 600;
}

.trend-up {
    color: #28a745;
}

.trend-neutral {
    color: #6c757d;
}

.trend-live {
    color: #dc3545;
    animation: pulse 2s infinite;
}

.stat-card-modern .stat-number {
    font-size: 3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-card-modern .stat-label {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.stat-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: color 0.3s;
}

.stat-link:hover {
    color: #764ba2;
}

.dashboard-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

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

.action-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border-left: 4px solid;
}

.action-card.action-primary {
    border-left-color: #667eea;
}

.action-card.action-success {
    border-left-color: #28a745;
}

.action-card.action-info {
    border-left-color: #17a2b8;
}

.action-card.action-warning {
    border-left-color: #ffc107;
}

.action-card:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.action-icon {
    font-size: 2.5em;
    flex-shrink: 0;
}

.action-content h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.2em;
}

.action-content p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

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

.live-match-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    position: relative;
}

.live-badge-top {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #dc3545;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.match-teams {
    text-align: center;
    margin: 20px 0;
}

.match-teams .team {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin: 5px 0;
}

.match-teams .vs {
    color: #999;
    font-weight: 600;
    margin: 10px 0;
}

.match-score {
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    margin: 15px 0;
}

.match-venue {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

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

.list-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: #f8f9fa;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.list-item-meta {
    font-size: 0.9em;
    color: #666;
}

.list-item-score {
    text-align: right;
    color: #667eea;
    font-size: 1.1em;
}

.rank-badge {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: #999;
}

@media (max-width: 768px) {
    .dashboard-welcome h1 {
        font-size: 1.8em;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
}