/* Table Styles for Galaxy Strike Online */

/* Base Table Styles */
.dungeon-table,
.skills-table,
.base-rooms-table,
.base-upgrades-table,
.ship-gallery-table,
.starbase-management-table,
.starbase-shop-table,
.quests-table,
.inventory-table,
.shop-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin: 10px 0;
}

.dungeon-table th,
.skills-table th,
.base-rooms-table th,
.base-upgrades-table th,
.ship-gallery-table th,
.starbase-management-table th,
.starbase-shop-table th,
.quests-table th,
.inventory-table th,
.shop-table th {
    background: var(--gradient-primary);
    color: var(--text-primary);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.dungeon-table td,
.skills-table td,
.base-rooms-table td,
.base-upgrades-table td,
.ship-gallery-table td,
.starbase-management-table td,
.starbase-shop-table td,
.quests-table td,
.inventory-table td,
.shop-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    font-size: 14px;
}

.dungeon-table tr:hover,
.skills-table tr:hover,
.base-rooms-table tr:hover,
.base-upgrades-table tr:hover,
.ship-gallery-table tr:hover,
.starbase-management-table tr:hover,
.starbase-shop-table tr:hover,
.quests-table tr:hover,
.inventory-table tr:hover,
.shop-table tr:hover {
    background: rgba(102, 126, 234, 0.1);
    transition: background 0.3s ease;
}

/* Dungeon Table Specific */
.dungeon-table .difficulty-easy { color: #00ff00; }
.dungeon-table .difficulty-medium { color: #ffff00; }
.dungeon-table .difficulty-hard { color: #ff9900; }
.dungeon-table .difficulty-extreme { color: #ff0000; }

/* Skills Table Specific */
.skills-table .skill-level {
    font-weight: bold;
    color: #667eea;
}

.skills-table .skill-progress {
    width: 100px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.skills-table .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

/* Base Tables Specific */
.base-rooms-table .room-status-active { color: #00ff00; }
.base-rooms-table .room-status-inactive { color: #ff0000; }
.base-rooms-table .room-status-upgrading { color: #ffff00; }

.base-upgrades-table .upgrade-level {
    font-weight: bold;
    color: #667eea;
}

/* Ship Gallery Grid Specific */
.ship-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.ship-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.ship-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
}

.ship-card.active {
    border-color: var(--success-color);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.2);
}

.ship-card.active::before {
    content: "ACTIVE";
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--gradient-secondary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ship-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.ship-card-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    margin: 0 auto;
}

.ship-card-info {
    text-align: center;
}

.ship-card-rarity {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
}

.ship-card-rarity.common {
    color: #888;
    border-color: #888;
}

.ship-card-rarity.rare {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.ship-card-rarity.epic {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.ship-card-rarity.legendary {
    color: var(--warning-color);
    border-color: var(--warning-color);
}

.ship-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.ship-card-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ship-card-stat .stat-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ship-card-stat .stat-value {
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 12px;
}

.ship-card-stat .stat-value.health {
    color: var(--success-color);
}

.ship-card-stat .stat-value.attack {
    color: var(--warning-color);
}

.ship-card-stat .stat-value.defense {
    color: var(--accent-color);
}

.ship-card-stat .stat-value.speed {
    color: var(--secondary-color);
}

.ship-card-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.ship-card-actions .btn-action {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    text-align: center;
}

.btn-action.btn-switch {
    background: var(--gradient-primary);
    color: var(--text-primary);
}

.btn-action.btn-switch:hover {
    background: var(--gradient-secondary);
    transform: translateY(-2px);
}

.btn-action.btn-switch:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.btn-action.btn-upgrade {
    background: var(--gradient-secondary);
    color: var(--text-primary);
}

.btn-action.btn-upgrade:hover {
    background: var(--gradient-primary);
    transform: translateY(-2px);
}

.btn-action.btn-repair {
    background: var(--gradient-secondary);
    color: var(--text-primary);
}

.btn-action.btn-repair:hover {
    background: var(--gradient-primary);
    transform: translateY(-2px);
}

/* Ship Gallery Layout */
.ship-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.current-ship-section {
    flex: 0 0 400px;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary-color);
}

.ship-grid-section {
    flex: 1;
    min-width: 0; /* Prevent flex item from overflowing */
}

.ship-grid-section h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.current-ship-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* Current Ship Display */
.current-ship-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.current-ship-image {
    flex-shrink: 0;
    order: 1;
}

.current-ship-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.current-ship-details {
    flex: 1;
    order: 2;
    min-width: 0;
    text-align: center;
}

.current-ship-details h5 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
}

.current-ship-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ship-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--hover-bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.ship-stat .stat-label {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ship-stat .stat-value {
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 14px;
}

.ship-stat .stat-value.health {
    color: var(--success-color);
}

.ship-stat .stat-value.attack {
    color: var(--warning-color);
}

.ship-stat .stat-value.defense {
    color: var(--accent-color);
}

.ship-stat .stat-value.speed {
    color: var(--secondary-color);
}

.ship-table-section {
    margin-top: 30px;
}

.ship-table-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ship-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .current-ship-section {
        flex: 1;
        width: 100%;
    }
    
    .current-ship-display {
        flex-direction: row;
        align-items: flex-start;
        gap: 15px;
    }
    
    .current-ship-image img {
        width: 100px;
        height: 100px;
    }
    
    .current-ship-stats {
        grid-template-columns: 1fr;
    }
    
    .ship-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px 0;
    }
    
    .ship-card {
        padding: 15px;
    }
    
    .ship-card-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }
    
    .ship-card-image {
        width: 80px;
        height: 80px;
    }
    
    .ship-card-stats {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .ship-card-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .ship-card-actions .btn-action {
        padding: 10px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ship-layout {
        gap: 15px;
    }
    
    .current-ship-section {
        padding: 15px;
    }
    
    .current-ship-display {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
    
    .current-ship-image {
        order: 1;
    }
    
    .current-ship-details {
        order: 2;
        text-align: center;
    }
    
    .ship-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 0;
    }
    
    .ship-card {
        padding: 12px;
    }
    
    .ship-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .ship-card-image {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }
    
    .ship-card-info {
        text-align: center;
    }
    
    .ship-card-name {
        font-size: 14px;
    }
    
    .ship-card-class {
        font-size: 11px;
    }
}

/* Console Window Styles */
.console-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    flex-direction: column;
    font-family: 'Courier New', monospace;
}

.console-header {
    background: var(--gradient-primary);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
}

.console-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.console-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.console-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.console-output {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.4;
    border-bottom: 1px solid var(--border-color);
}

.console-output .console-line {
    margin-bottom: 5px;
    word-wrap: break-word;
}

.console-output .console-error {
    color: var(--error-color);
}

.console-output .console-success {
    color: var(--success-color);
}

.console-output .console-warning {
    color: var(--warning-color);
}

.console-output .console-info {
    color: var(--primary-color);
}

.console-input-container {
    padding: 10px;
    background: var(--bg-secondary);
}

.console-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border-radius: 4px;
    outline: none;
}

.console-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

/* Starbase Tables Specific */
.starbase-management-table .starbase-level {
    font-weight: bold;
    color: #667eea;
}

.starbase-shop-table .starbase-cost {
    font-weight: bold;
    color: #ffd700;
}

/* Quests Table Specific */
.quests-table .quest-type-main { color: #667eea; }
.quests-table .quest-type-daily { color: #00ff00; }
.quests-table .quest-type-procedural { color: #ff9900; }
.quests-table .quest-type-completed { color: #888888; }
.quests-table .quest-type-failed { color: #ff0000; }

.quests-table .quest-progress {
    width: 100px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.quests-table .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #00cc00);
    transition: width 0.3s ease;
}

/* Inventory Table Specific */
.inventory-table .item-rarity-common { color: #888888; }
.inventory-table .item-rarity-uncommon { color: #00ff00; }
.inventory-table .item-rarity-rare { color: #0088ff; }
.inventory-table .item-rarity-epic { color: #8833ff; }
.inventory-table .item-rarity-legendary { color: #ff8800; }

.inventory-table .item-stats {
    font-size: 12px;
    color: #cccccc;
}

/* Shop Table Specific */
.shop-table .item-price {
    font-weight: bold;
    color: #ffd700;
}

.shop-table .item-description {
    font-size: 12px;
    color: #cccccc;
    max-width: 200px;
}

/* Action Buttons */
.dungeon-table .btn-action,
.skills-table .btn-action,
.base-rooms-table .btn-action,
.base-upgrades-table .btn-action,
.ship-gallery-table .btn-action,
.starbase-management-table .btn-action,
.starbase-shop-table .btn-action,
.quests-table .btn-action,
.inventory-table .btn-action,
.shop-table .btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

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

.btn-action.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
}

.btn-action.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-action.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-action.btn-success {
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    color: white;
}

.btn-action.btn-success:hover {
    background: linear-gradient(135deg, #00cc00 0%, #00ff00 100%);
    transform: translateY(-1px);
}

.btn-action.btn-danger {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
}

.btn-action.btn-danger:hover {
    background: linear-gradient(135deg, #cc0000 0%, #ff0000 100%);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dungeon-table,
    .skills-table,
    .base-rooms-table,
    .base-upgrades-table,
    .ship-gallery-table,
    .starbase-management-table,
    .starbase-shop-table,
    .quests-table,
    .inventory-table,
    .shop-table {
        font-size: 12px;
    }
    
    .dungeon-table th,
    .skills-table th,
    .base-rooms-table th,
    .base-upgrades-table th,
    .ship-gallery-table th,
    .starbase-management-table th,
    .starbase-shop-table th,
    .quests-table th,
    .inventory-table th,
    .shop-table th {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .dungeon-table td,
    .skills-table td,
    .base-rooms-table td,
    .base-upgrades-table td,
    .ship-gallery-table td,
    .starbase-management-table td,
    .starbase-shop-table td,
    .quests-table td,
    .inventory-table td,
    .shop-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .btn-action {
        padding: 4px 8px;
        font-size: 10px;
    }
}
