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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    color: #333;
}

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

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

h1 {
    color: #2c3e50;
}

.resources-display {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.resource {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.2rem;
    font-weight: bold;
}

.resource-icon {
    font-size: 1.5rem;
}

#total-money {
    color: #9C27B0;
    animation: pulse-money 2s infinite;
}

#inventory-value {
    color: #2196F3;
    animation: pulse-inventory 3s infinite;
}

#total-money .resource-label, #inventory-value .resource-label {
    font-size: 0.9rem;
    font-weight: normal;
    margin-right: 5px;
}

@keyframes pulse-money {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulse-inventory {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* Game Area Styles */
.game-area {
    display: flex;
    gap: 20px;
}

/* Controls Panel Styles */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 150px;
}

.control-btn {
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

.control-btn.danger {
    background-color: #e74c3c;
}

.control-btn.danger:hover {
    background-color: #c0392b;
}

/* Mining Area Styles */
.mining-area {
    flex: 2;
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

#mining-canvas {
    width: 100%;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    transition: transform 0.1s ease;
}

.depth-indicator {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    display: flex;
    gap: 15px;
    z-index: 10;
}

.depth-value, .layer-value {
    display: flex;
    align-items: center;
    gap: 5px;
}

.depth-value::before {
    content: "🧭";
    font-size: 16px;
}

.layer-value::before {
    content: "📊";
    font-size: 16px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modal-appear 0.3s ease;
}

.modal-content h2 {
    margin-top: 0;
    color: #e74c3c;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.modal-buttons button.danger {
    background-color: #e74c3c;
    color: white;
}

.modal-buttons button.danger:hover {
    background-color: #c0392b;
}

.modal-buttons button:not(.danger) {
    background-color: #95a5a6;
    color: white;
}

.modal-buttons button:not(.danger):hover {
    background-color: #7f8c8d;
}

@keyframes modal-appear {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* Side Panel Styles */
.side-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 800px;
    overflow-y: auto;
}

.panel-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h2 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.3rem;
}

/* Inventory and Upgrades */
#inventory-list, #upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inventory-item, .upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.inventory-item.empty {
    color: #999;
    font-style: italic;
    justify-content: center;
}

.inventory-item.valuable {
    background-color: #FFF9C4;
    border-color: #FFC107;
    box-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
    animation: glow 2s infinite;
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(255, 193, 7, 0.5); }
    50% { box-shadow: 0 0 10px rgba(255, 193, 7, 0.8); }
    100% { box-shadow: 0 0 5px rgba(255, 193, 7, 0.5); }
}

.upgrade-item {
    position: relative;
    overflow: hidden;
}

.upgrade-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.upgrade-item.hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
    opacity: 0.5;
}

.upgrade-item.max-level {
    background-color: #E8F5E9;
    border-color: #4CAF50;
}

.upgrade-item.can-afford {
    border-color: #2196F3;
}

.upgrade-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.upgrade-icon {
    font-size: 1.2rem;
}

.upgrade-level {
    font-size: 0.8rem;
    color: #666;
    margin-left: 5px;
}

.upgrade-effect {
    font-size: 0.8rem;
    color: #2196F3;
    margin-top: 5px;
}

.upgrade-item button {
    padding: 5px 10px;
    font-size: 0.9rem;
    min-width: 100px;
}

.upgrade-item button.max {
    background-color: #4CAF50;
}

.upgrade-item button.cant-afford {
    background-color: #9E9E9E;
}

/* Research Styles */
.research-points, .research-rate {
    margin-bottom: 10px;
    font-weight: bold;
    color: #2196F3;
}

.research-info {
    margin-bottom: 15px;
    font-style: italic;
    color: #666;
}

.research-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.research-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.research-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.research-item.completed {
    background-color: #e8f5e9;
    border-color: #a5d6a7;
}

.research-item.active {
    background-color: #e3f2fd;
    border-color: #90caf9;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(33, 150, 243, 0); }
    100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
}

.research-item.locked {
    opacity: 0.7;
}

.research-info {
    flex: 2;
}

.research-info h3 {
    margin-bottom: 5px;
    font-size: 1.1rem;
    color: #2c3e50;
}

.research-requirements {
    font-size: 0.9rem;
    margin-top: 5px;
}

.research-requirements .met {
    color: #4caf50;
    font-weight: bold;
}

.research-requirements .unmet {
    color: #f44336;
}

.research-status {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
}

.research-progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.research-progress-bar .progress {
    height: 100%;
    background-color: #4caf50;
    background-image: linear-gradient(45deg, 
        rgba(255,255,255,.15) 25%, transparent 25%, 
        transparent 50%, rgba(255,255,255,.15) 50%, 
        rgba(255,255,255,.15) 75%, transparent 75%, 
        transparent);
    background-size: 20px 20px;
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    from { background-position: 20px 0; }
    to { background-position: 0 0; }
}

.completed-badge {
    background-color: #4caf50;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.active-badge {
    background-color: #2196F3;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    animation: pulse-text 2s infinite;
}

@keyframes pulse-text {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Notifications */
.notifications {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 300px;
    z-index: 1000;
}

.notification {
    background-color: #2ecc71;
    color: white;
    padding: 10px 15px;
    margin-top: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: fadeOut 5s forwards;
}

.notification.error {
    background-color: #e74c3c;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* Visual Effects */
.layer-transition {
    animation: flash 1s;
}

@keyframes flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
    100% { filter: brightness(1); }
}
