/* Presidential Election Simulation - CSS Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.game-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border-bottom: 3px solid #c41e3a;
}

.game-header h1 {
    color: #1e3c72;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    gap: 2rem;
    font-weight: bold;
    color: #2a5298;
}

.game-info span {
    background: rgba(30, 60, 114, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(30, 60, 114, 0.3);
}

/* Screen Management */
.screen {
    display: none;
    flex: 1;
    padding: 2rem;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Menu Styles */
.menu-container, .setup-container, .party-container, .main-menu-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
}

.menu-container h2, .setup-container h2, .party-container h2, .main-menu-container h2 {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.menu-options, .menu-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.menu-btn {
    background: linear-gradient(135deg, #c41e3a 0%, #e74c3c 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
    text-align: left;
}

.menu-btn:hover {
    background: linear-gradient(135deg, #a01729 0%, #c0392b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

.menu-btn:active {
    transform: translateY(0);
}

/* Setup Form Styles */
.setup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.setup-form label {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1e3c72;
}

.setup-form input {
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    width: 200px;
    text-align: center;
}

.setup-form input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 10px rgba(42, 82, 152, 0.3);
}

.setup-form button {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.setup-form button:hover {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.3);
}

/* Party Setup Styles */
.party-form {
    background: rgba(242, 245, 247, 0.8);
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.party-form:hover {
    border-color: #2a5298;
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.1);
}

.party-form h3 {
    color: #1e3c72;
    margin-bottom: 1rem;
    border-bottom: 2px solid #c41e3a;
    padding-bottom: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.form-row label {
    font-weight: bold;
    color: #2a5298;
}

.form-row input, .form-row select {
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.form-row input:focus, .form-row select:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 8px rgba(42, 82, 152, 0.2);
}

/* Campaign Screen Styles */
.campaign-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.status-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.candidate-info, .location-info {
    background: rgba(242, 245, 247, 0.8);
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 4px solid #c41e3a;
}

.candidate-info h3 {
    color: #1e3c72;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-align: center;
    background: rgba(30, 60, 114, 0.1);
    padding: 0.5rem;
    border-radius: 6px;
}

.financial-info, .location-info {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.fund-item, .location-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e6ed;
}

.fund-item span:first-child, .location-item span:first-child {
    font-weight: bold;
    color: #2a5298;
}

.fund-item span:last-child, .location-item span:last-child {
    font-weight: bold;
    color: #c41e3a;
}

/* Action Panel Styles */
.action-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-panel h3 {
    color: #1e3c72;
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #c41e3a;
}

.action-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.action-btn {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 3px 10px rgba(30, 60, 114, 0.3);
}

.action-btn:hover {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.4);
}

.action-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.action-btn.used {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    cursor: not-allowed;
}

.action-btn.used::after {
    content: " **ALREADY USED TODAY**";
    font-style: italic;
    opacity: 0.8;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: scale(0.9) translateY(-20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
    max-height: 400px;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #e0e6ed;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(242, 245, 247, 0.8);
    border-radius: 0 0 15px 15px;
}

/* Button Styles */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #c41e3a 0%, #e74c3c 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #a01729 0%, #c0392b 100%);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    transform: translateY(-2px);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e6ed;
}

th {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: rgba(42, 82, 152, 0.05);
}

tr:last-child td {
    border-bottom: none;
}

/* State Grid Styles */
.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.state-item {
    background: rgba(242, 245, 247, 0.8);
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    padding: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.state-item:hover {
    border-color: #2a5298;
    background: rgba(42, 82, 152, 0.1);
    transform: translateY(-2px);
}

.state-item.selected {
    border-color: #c41e3a;
    background: rgba(196, 30, 58, 0.1);
}

.state-number {
    font-weight: bold;
    color: #1e3c72;
    margin-bottom: 0.3rem;
}

.state-abbr {
    font-size: 0.9rem;
    color: #2a5298;
}

/* Loading Screen */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: white;
}

.loading-container h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Screen */
.results-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 1000px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
}

.results-container h2 {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .game-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .campaign-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .state-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .screen {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .menu-container, .setup-container, .party-container, .main-menu-container, .results-container {
        padding: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
}