/* === UNIT PROFILES STYLES === */
.profiles-body {
    min-height: 100vh;
    padding: 20px 20px 100px 20px;
    font-family: 'Arial', sans-serif;
    margin: 0;
    position: relative;
    background: transparent !important;
}

.profiles-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/background.jpg') center center / cover no-repeat;
    z-index: -1;
}

.profiles-container {
    max-width: 800px;
    margin: 0 auto;
}

.profiles-header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 3px solid #3498db;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.logo-container {
    margin-bottom: 20px;
}

.profiles-logo {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.8));
    transition: transform 0.3s ease;
}

.profiles-logo:hover {
    transform: scale(1.05);
}

.profiles-title {
    color: #3498db;
    font-size: 2.5rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
    margin: 15px 0 10px 0;
    background: linear-gradient(135deg, #3498db, #5dade2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profiles-subtitle {
    font-size: 1.2rem;
    color: #ecf0f1;
    opacity: 0.9;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    margin: 0;
}

/* Units Grid */
.units-grid {
    margin-bottom: 100px;
}

.unit-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.unit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #5dade2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.unit-card:hover::before {
    opacity: 1;
}

.unit-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.2);
    border-color: #3498db;
}

.unit-card-content {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 20px;
    position: relative;
}

.unit-image-container {
    flex-shrink: 0;
    width: 120px;        /* ← Změna z 60px na 120px */
    height: 120px;       /* ← Změna z 60px na 120px */
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.unit-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.unit-card:hover .unit-image {
    transform: scale(1.05);
}

.unit-image-placeholder {
    font-size: 4rem;     /* ← Změna ze 3rem na 4rem */
    color: #6c757d;
}

/* Mobile responsive pro unit cards */
@media (max-width: 768px) {
    .unit-image-container {
        width: 100px;    /* ← Pro mobil trochu menší */
        height: 100px;
    }
    
    .unit-image-placeholder {
        font-size: 3.5rem;
    }
}

@media (max-width: 480px) {
    .unit-image-container {
        width: 90px;     /* ← Pro malé mobily */
        height: 90px;
    }
    
    .unit-image-placeholder {
        font-size: 3rem;
    }
}

.unit-info {
    flex: 1;
}

.unit-name {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
}

.unit-type {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.unit-stats-preview {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-preview {
    color: #495057;
    font-weight: 500;
}

.unit-special-preview {
    color: #3498db;
    font-size: 0.85rem;
    font-style: italic;
}

.unit-expand-hint {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    color: #3498db;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.unit-card:hover .unit-expand-hint {
    transform: translateY(-50%) scale(1.2);
}

.unit-card-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    transform: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.quick-add-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
    z-index: 10;
}

.quick-add-btn:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(39, 174, 96, 0.4);
}

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

.unit-expand-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    color: #3498db;
    font-size: 2.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.unit-expand-hint:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: scale(1.1);
}

/* Modal Styles */
.unit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.unit-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.unit-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.unit-modal-overlay.visible .unit-modal-content {
    transform: scale(1);
}

.unit-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.unit-modal-close:hover {
    color: #333;
}

.unit-detail-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.unit-image-large {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    object-fit: cover;
    border: 3px solid #3498db;
    box-shadow: 0 8px 16px rgba(52, 152, 219, 0.2);
}

.unit-image-large-container {
    display: flex;
    align-items: center;  
    justify-content: center;
}

.unit-basic-info h2 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 2rem;
}

.unit-type {
    font-size: 1rem;
    margin: 0;
}

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

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.stat-item:hover {
    border-color: #3498db;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.unit-special-section {
    background: rgba(52, 152, 219, 0.1);
    border: 2px solid rgba(52, 152, 219, 0.3);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.unit-special-section h3 {
    margin: 0 0 15px 0;
    color: #3498db;
    font-size: 1.3rem;
}

.special-ability h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.special-ability p {
    margin: 0;
    color: #495057;
    line-height: 1.5;
}

.unit-actions {
    text-align: center;
}

.add-to-team-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.add-to-team-btn:hover {
    background: linear-gradient(135deg, #27ae60, #219a52);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 204, 113, 0.4);
}

/* Team Selection Modal */
.team-select-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.team-select-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.team-select-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.team-select-overlay.visible .team-select-content {
    transform: scale(1);
}

.team-select-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.5rem;
}

.team-select-content p {
    margin: 0 0 25px 0;
    color: #666;
}

.team-select-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.team-select-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.red-team-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.red-team-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
}

.blue-team-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.blue-team-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f6391);
    transform: translateY(-2px);
}

.cancel-team-select {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cancel-team-select:hover {
    background: #7f8c8d;
}

/* Fixed back button */
.fixed-back-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px;
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    backdrop-filter: blur(10px);
}

.fixed-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    max-width: 300px;
    margin: 0 auto;
    border: 2px solid transparent;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

.fixed-back-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f6391);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.4);
    border-color: #5dade2;
}

.bottom-spacing {
    height: 80px;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #3498db;
    color: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    font-size: 1.1em;
    font-weight: 500;
    transition: opacity 0.3s ease;
    max-width: 350px;
    word-wrap: break-word;
}

.notification-success {
    background: #27ae60;
}

.notification-warning {
    background: #f39c12;
}

.notification-error {
    background: #e74c3c;
}

.notification-info {
    background: #3498db;
}

/* Mobile notification positioning */
@media (max-width: 768px) {
    .notification {
        top: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        max-width: calc(100vw - 40px);
        width: auto;
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .notification {
        top: 15px;
        left: 15px;
        right: 15px;
        transform: none;
        max-width: none;
        width: auto;
        min-width: auto;
        text-align: center;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .profiles-body {
        padding: 15px 15px 120px 15px;
    }
    
    .profiles-header {
        padding: 25px 20px;
    }
    
    .profiles-logo {
        max-width: 100px;
        max-height: 100px;
    }
    
    .profiles-title {
        font-size: 2rem;
    }
    
    .unit-card-content {
        padding: 15px;
        gap: 15px;
    }
    
    .unit-image-container {
        width: 100px;    /* ← Pro mobil trochu menší */
        height: 100px;
    }
    
    .unit-name {
        font-size: 1.1rem;
    }
    
    .unit-stats-preview {
        flex-direction: column;
        gap: 5px;
    }
    
    .unit-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .unit-image-large {
        width: 230px;
        height: 230px;
    }
    
    .unit-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .team-select-buttons {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .unit-modal-content {
        padding: 25px 20px;
        margin: 10px;
    }
    
    .unit-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .unit-image-container {
        width: 90px;     /* ← Pro malé mobily */
        height: 90px;
    }
    
    .unit-expand-hint {
        right: 15px;
        font-size: 1.2rem;
    }
    
    .quick-add-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .unit-expand-hint {
        font-size: 1.1rem;
        width: 28px;
        height: 28px;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .unit-card-actions {
        top: 12px;
        right: 12px;
        gap: 6px;
    }
    
    .quick-add-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .unit-expand-hint {
        font-size: 2rem;
        width: 36px;
        height: 36px;
        bottom: 12px;
        right: 12px;
    }
}

@media (max-width: 480px) {
    .unit-card-actions {
        top: 10px;
        right: 10px;
        gap: 4px;
    }
    
    .quick-add-btn {
        width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }
    
    .unit-expand-hint {
        font-size: 1.8rem;
        width: 32px;
        height: 32px;
        bottom: 10px;
        right: 10px;
    }
}