/* Charter CRM - Professional Styling */

/* Reset and Base Styles */
.charter-crm-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f8fafc;
    min-height: 100vh;
}

.charter-crm-app * {
    box-sizing: border-box;
}

/* Navigation */
.crm-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.crm-nav h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.crm-nav-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.crm-nav-button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.crm-nav-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.crm-nav-button.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Dashboard Grid */
.crm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Cards */
.crm-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.crm-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Buttons */
.crm-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.crm-button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.crm-button-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.crm-button-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    font-size: 0.875rem;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

table tr:hover {
    background-color: #f8fafc;
}

table tr:last-child td {
    border-bottom: none;
}

/* Modals */
.crm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.crm-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

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

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
}

/* Aircraft Images */
.aircraft-image-gallery {
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.aircraft-image-single {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.aircraft-image-grid {
    display: grid;
    gap: 2px;
    height: 200px;
}

.aircraft-image-grid.two-images {
    grid-template-columns: 1fr 1fr;
}

.aircraft-image-grid.three-images {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.aircraft-image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aircraft-image-grid.three-images img:first-child {
    grid-row: span 2;
}

/* Image Upload */
.image-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
}

.image-upload-area:hover {
    border-color: #667eea;
    background: #f1f5f9;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.image-preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Login Form */
.charter-crm-login {
    max-width: 400px;
    margin: 3rem auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 2rem;
}

.login-form {
    padding: 2rem;
}

/* Save Button Styling */
.save-button-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.save-button {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.save-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.save-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.save-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.save-status-detail {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Spinning animation for save button */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Navigation adjustments for save button */
.crm-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.crm-nav-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Responsive adjustments for save button */
@media (max-width: 1024px) {
    .save-button-container {
        padding: 0.375rem 0.75rem;
    }
    
    .save-button {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .save-status {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .save-button-container {
        flex-direction: column;
        align-items: center;
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .save-status {
        align-items: center;
        text-align: center;
    }
    
    .crm-nav-buttons {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: center;
    }
}

/* Aircraft Grid - Compact Layout for Many Aircraft */
.aircraft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.aircraft-card-compact {
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.aircraft-card-compact:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.05);
}

.aircraft-image-compact {
    height: 120px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: #f8fafc;
}

.aircraft-info-compact {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aircraft-title-compact {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    color: #1f2937;
}

.aircraft-details-compact {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.aircraft-meta-compact {
    font-size: 0.8rem;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.aircraft-operator-compact {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.aircraft-actions-compact {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.aircraft-btn-compact {
    flex: 1;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.aircraft-btn-edit {
    background-color: #3b82f6;
    color: white;
}

.aircraft-btn-edit:hover {
    background-color: #2563eb;
}

.aircraft-btn-delete {
    background-color: #dc2626;
    color: white;
}

.aircraft-btn-delete:hover {
    background-color: #b91c1c;
}

/* Responsive adjustments for aircraft grid */
@media (max-width: 1400px) {
    .aircraft-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

@media (max-width: 1200px) {
    .aircraft-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 0.75rem;
    }
    
    .aircraft-card-compact {
        min-height: 300px;
        padding: 0.875rem;
    }
    
    .aircraft-image-compact {
        height: 100px;
    }
}

@media (max-width: 768px) {
    .aircraft-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 0.5rem;
    }
    
    .aircraft-card-compact {
        min-height: 280px;
        padding: 0.75rem;
    }
    
    .aircraft-image-compact {
        height: 80px;
    }
}
    .crm-nav-buttons {
        gap: 0.25rem;
    }
    
    .crm-nav-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .crm-dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .crm-modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
}

@media (max-width: 640px) {
    .crm-nav {
        padding: 1rem 0;
    }
    
    .crm-nav h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .crm-nav-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .crm-nav-button {
        text-align: center;
    }
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

.status-badge.booked {
    background-color: #dcfce7;
    color: #166534;
}

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

/* Action Buttons */
.action-btn {
    padding: 0.375rem 0.875rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-btn.edit {
    background-color: #f59e0b;
    color: white;
}

.action-btn.copy {
    background-color: #8b5cf6;
    color: white;
}

.action-btn.pdf {
    background-color: #3b82f6;
    color: white;
}

.action-btn.book {
    background-color: #059669;
    color: white;
}

.action-btn.lost {
    background-color: #6b7280;
    color: white;
}

.action-btn.delete {
    background-color: #dc2626;
    color: white;
}

.action-btn.restore {
    background-color: #059669;
    color: white;
}

/* Selection UI */
.selection-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #93c5fd;
    font-weight: 600;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error States */
.error {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
}

/* Success States */
.success {
    background-color: #dcfce7;
    color: #166534;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #bbf7d0;
}

/* Checkbox Styling */
input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    border: 2px solid #d1d5db;
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background-color: #667eea;
    border-color: #667eea;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
    background: white;
    border-radius: 0.75rem;
    border: 2px dashed #e5e7eb;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}
