/**
 * Player Profile Builder CSS
 * Clean, Professional Templates
 */

/* Base Styles */
.player-profile-container {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Form Panel Styles */
.player-profile-form-panel {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.player-profile-form-panel h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
}

.form-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
}

.template-selector {
    background: #333;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.template-selector h3 {
    color: white !important;
    margin-bottom: 10px;
    font-size: 1rem;
}

.template-dropdown {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    color: #333;
    cursor: pointer;
}

.form-section h3 {
    color: #555;
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: #555;
    font-weight: 500;
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #333;
}

.form-group textarea {
    height: 50px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.add-btn {
    background: #333;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

.add-btn:hover {
    background: #555;
}

.save-profile-btn {
    background: #2c5282;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    width: 100%;
    transition: background-color 0.3s ease;
}

.save-profile-btn:hover {
    background: #2a4971;
}

/* Photo Upload Styles */
.photo-upload-container {
    position: relative;
}

.photo-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.photo-preview {
    width: 100px;
    height: 120px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.photo-preview:hover {
    border-color: #333;
    background: #f9f9f9;
}

.photo-preview.has-image {
    border-style: solid;
    border-color: #333;
}

.photo-placeholder {
    text-align: center;
    color: #666;
}

.photo-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 5px;
}

.photo-text {
    font-size: 0.7rem;
    font-weight: 500;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.photo-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    background: #dc3545;
    color: white;
    border: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.6rem;
    display: none;
    align-items: center;
    justify-content: center;
}

.photo-preview.has-image .photo-remove {
    display: flex;
}

.photo-preview.has-image .photo-placeholder {
    display: none;
}

/* Shared Display Styles */
.player-profile-display {
    background: white;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    min-height: 800px;
}

.pdf-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #333;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 10;
}

.pdf-button:hover {
    background: #555;
}

.profile-photo-display {
    background: #f8f8f8;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-photo-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder-display {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
}

/* PROFESSIONAL TEMPLATE */
.professional-template {
    display: block;
}

.profile-header {
    background: #f8f9fa;
    padding: 25px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-info h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-weight: 700;
    letter-spacing: 1px;
}

.player-details {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.school-info {
    font-size: 0.9rem;
    color: #868e96;
}

.header-photo .profile-photo-display {
    width: 120px;
    height: 150px;
    border-radius: 4px;
}

.profile-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.left-column {
    background: #f8f9fa;
    padding: 25px;
    border-right: 1px solid #dee2e6;
}

.right-column {
    background: white;
    padding: 25px;
}

.info-section {
    margin-bottom: 25px;
}

.info-section h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 4px;
    display: inline-block;
}

.info-grid {
    display: grid;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dotted #ced4da;
    font-size: 0.85rem;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    font-weight: 600;
    color: #495057;
}

.info-item .value {
    color: #2c3e50;
}

.contact-info {
    display: grid;
    gap: 12px;
}

.contact-item {
    font-size: 0.85rem;
    line-height: 1.4;
}

.contact-item strong {
    color: #2c3e50;
}

.achievements-list,
.clubs-list {
    display: grid;
    gap: 8px;
}

.achievement-item,
.club-item {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #495057;
    position: relative;
    padding-left: 15px;
}

.achievement-item:before,
.club-item:before {
    content: '•';
    position: absolute;
    left: 0;
    color: #007bff;
    font-weight: bold;
}

.achievement-item:last-child,
.club-item:last-child {
    border-bottom: none;
}

/* ACADEMIC TEMPLATE */
.academic-template {
    display: none;
}

.academic-header {
    background: #2c5282;
    color: white;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.school-logo-area .profile-photo-display {
    width: 80px;
    height: 100px;
    border-radius: 4px;
    border: 2px solid white;
}

.player-title h1 {
    font-size: 1.8rem;
    margin: 0 0 5px 0;
    font-weight: 700;
}

.player-title h2 {
    font-size: 1rem;
    margin: 0 0 5px 0;
    font-weight: 400;
    opacity: 0.9;
}

.student-id {
    font-size: 0.8rem;
    opacity: 0.8;
}

.academic-body {
    padding: 25px;
}

.section-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.section-row.full-width {
    grid-template-columns: 1fr;
}

.section-box {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.section-box h3 {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 10px 15px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table td {
    padding: 8px 15px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 0.8rem;
}

.info-table td:first-child {
    font-weight: 600;
    color: #495057;
    width: 40%;
}

.info-table td:last-child {
    color: #2c3e50;
}

.info-table tr:last-child td {
    border-bottom: none;
}

.school-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    padding: 10px 15px 0 15px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 15px;
}

.achievements-column h4 {
    color: #2c3e50;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.academic-achievements,
.academic-clubs {
    display: grid;
    gap: 6px;
}

.academic-achievements .achievement-item,
.academic-clubs .club-item {
    font-size: 0.8rem;
    padding: 4px 0;
    border-bottom: 1px solid #f1f3f4;
    color: #495057;
}

/* ATHLETIC TEMPLATE */
.athletic-template {
    display: none;
}

.athletic-header {
    background: white;
    padding: 25px;
    border-bottom: 3px solid #2c5282;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 25px;
    align-items: start;
}

.header-left .profile-photo-display {
    width: 150px;
    height: 200px;
    border-radius: 4px;
    border: 2px solid #2c5282;
}

.jersey-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: #2c5282;
    margin-bottom: 5px;
}

.header-right h1 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.player-subtitle {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 15px;
    font-weight: 500;
}

.team-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.team-section {
    font-size: 0.85rem;
    line-height: 1.4;
}

.team-section strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 3px;
}

.contact-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.contact-section .contact-item {
    font-size: 0.8rem;
    line-height: 1.4;
}

.contact-section strong {
    color: #2c3e50;
}

.athletic-body {
    padding: 25px;
}

.stats-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f3f4;
}

.physical-stats h3,
.academic-stats h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    background: #f8f9fa;
    padding: 12px 8px;
    border-radius: 4px;
    border-left: 3px solid #2c5282;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 3px;
}

.stat-label {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
}

.achievements-section,
.activities-section {
    margin-bottom: 20px;
}

.achievements-section h3,
.activities-section h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
    border-bottom: 2px solid #2c5282;
    padding-bottom: 4px;
    display: inline-block;
}

.athletic-achievements,
.athletic-clubs {
    display: grid;
    gap: 8px;
}

.athletic-achievements .achievement-item,
.athletic-clubs .club-item {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #495057;
    position: relative;
    padding-left: 15px;
}

.athletic-achievements .achievement-item:before,
.athletic-clubs .club-item:before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #2c5282;
    font-weight: bold;
}

/* Template switching animations */
.template-switching {
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .player-profile-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .player-profile-form-panel {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .profile-body {
        grid-template-columns: 1fr;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .section-row {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .athletic-header {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 15px;
    }
    
    .team-info,
    .contact-section {
        grid-template-columns: 1fr;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .player-profile-form-panel {
        display: none !important;
    }
    
    .player-profile-container {
        grid-template-columns: 1fr !important;
        background: white !important;
        padding: 0 !important;
    }
    
    .pdf-button {
        display: none !important;
    }
    
    .player-profile-display {
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    
    @page {
        margin: 0.5in;
        size: letter;
    }
}