/* Admin Panel Responsive Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Base Variables */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.2s ease-in-out;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--light-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.admin-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow-x: hidden;
}

/* Header */
.admin-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 1rem;
}

.header-content h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Navigation */
.admin-nav {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    overflow-x: auto;
    position: sticky;
    top: 60px;
    z-index: 90;
}

.nav-tabs {
    display: flex;
    gap: 0.25rem;
    min-width: max-content;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    min-width: fit-content;
}

.nav-tab:hover {
    color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

/* Main Content */
.admin-main {
    flex: 1;
    padding: 1.5rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Sections */
.admin-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.admin-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form Controls */
input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--transition);
    background-color: white;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--text-secondary);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #5a67d8;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

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

.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

/* Cards */
.item-card, .enhanced-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.item-card:hover, .enhanced-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.item-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.enhanced-form {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Lists */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-item {
    display: flex;
    align-items: end;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

/* Stats and Badges */
.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.collaboration-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Photo Management */
.profile-photo-section {
    margin-bottom: 2rem;
}

.photo-management {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.current-photo-display {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border-color);
}

.current-photo-display img,
.current-photo-display svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Success Message */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}

.success-message.show {
    transform: translateX(0);
}

/* PDF and CV Request Styles */
.pdf-stats-grid, .cv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.pdf-stat-card, .cv-stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.pdf-stat-card h3, .cv-stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pdf-stat-number, .cv-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Filters */
.cv-filters-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Request Items */
.cv-request-item, .collaboration-request-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.cv-request-header, .request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.cv-request-info h4, .request-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cv-request-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cv-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-in-progress {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.cv-request-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-group h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-group p {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.cv-request-actions, .request-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .admin-header {
        padding: 0.75rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .header-content h1 {
        font-size: 1.125rem;
        justify-content: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .admin-nav {
        padding: 0 0.5rem;
    }
    
    .nav-tab {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .admin-main {
        padding: 1rem 0.75rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .section-header h2 {
        font-size: 1.25rem;
        text-align: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .item-form, .enhanced-form {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .item-actions {
        justify-content: center;
    }
    
    .skill-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .photo-management {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .collaboration-stats {
        justify-content: center;
    }
    
    .pdf-stats-grid, .cv-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .cv-request-header, .request-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cv-request-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cv-request-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .cv-request-actions, .request-actions {
        justify-content: center;
    }
    
    .success-message {
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }
    
    .success-message.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    .admin-header {
        padding: 0.5rem;
    }
    
    .header-content h1 {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .btn-small {
        padding: 0.375rem 0.625rem;
        font-size: 0.6875rem;
    }
    
    .nav-tab {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .admin-main {
        padding: 0.75rem 0.5rem;
    }
    
    .section-header h2 {
        font-size: 1.125rem;
    }
    
    input, textarea, select {
        padding: 0.625rem;
        font-size: 0.8125rem;
    }
    
    .item-card, .enhanced-card {
        padding: 1rem;
    }
    
    .item-title {
        font-size: 1rem;
    }
    
    .current-photo-display {
        width: 60px;
        height: 60px;
    }
    
    .pdf-stats-grid, .cv-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .pdf-stat-number, .cv-stat-number {
        font-size: 1.5rem;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    
    .item-form {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .enhanced-form {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    
    .pdf-stats-grid, .cv-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .filters-row {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Print Styles */
@media print {
    .admin-header,
    .admin-nav,
    .btn,
    .success-message {
        display: none !important;
    }
    
    .admin-main {
        padding: 0;
        max-width: none;
    }
    
    .item-card, .enhanced-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #111827;
        --border-color: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
    }
    
    body {
        background-color: var(--dark-color);
    }
    
    input, textarea, select,
    .item-card, .enhanced-card,
    .pdf-stat-card, .cv-stat-card,
    .cv-filters-section,
    .cv-request-item, .collaboration-request-item {
        background-color: #1f2937;
        border-color: var(--border-color);
        color: var(--text-primary);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Accessibility */
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.nav-tab:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}