/* Admin Dashboard Styles */

/* Admin Login Page */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.admin-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid #3498db;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #7f8c8d;
    font-size: 1rem;
}

.login-form {
    text-align: left;
}

.login-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* Admin Dashboard Layout */
.admin-page {
    background: #f8f9fa;
    min-height: 100vh;
}

.admin-nav {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.nav-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-item {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: #f1f2f6;
    color: #2c3e50;
}

.nav-item.active {
    background: #3498db;
    color: white;
}

/* Admin Sections */
.admin-section {
    display: none;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-section.active {
    display: block;
    animation: fadeInUp 0.6s ease-out;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #7f8c8d;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Recent Activity */
.recent-activity {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.recent-activity h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.activity-icon {
    font-size: 1.5rem;
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.activity-content p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.activity-time {
    color: #95a5a6;
    font-size: 0.85rem;
}

/* Clients Section */
.clients-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.search-input,
.filter-select {
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
}

.search-input {
    flex: 1;
    max-width: 300px;
}

.filter-select {
    min-width: 150px;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.client-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.client-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.client-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.client-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.client-status.welcome {
    background: #e8f4fd;
    color: #3498db;
}

.client-status.documents {
    background: #fff3cd;
    color: #f39c12;
}

.client-status.matching {
    background: #d4edda;
    color: #27ae60;
}

.client-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.client-detail {
    font-size: 0.9rem;
}

.client-detail strong {
    color: #2c3e50;
}

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

.client-action-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn {
    background: #3498db;
    color: white;
}

.view-btn:hover {
    background: #2980b9;
}

.contact-btn {
    background: #27ae60;
    color: white;
}

.contact-btn:hover {
    background: #229954;
}

/* Property Upload */
.property-upload-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.property-upload-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #2980b9;
    background: #f8fbff;
}

.upload-area.dragover {
    border-color: #27ae60;
    background: #f0fff4;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #3498db;
}

.upload-placeholder p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.image-preview {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
}

.image-preview img {
    width: 100%;
    border-radius: 8px;
}

.remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.upload-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.upload-btn:hover {
    background: #229954;
    transform: translateY(-1px);
}

/* Properties Grid */
.properties-list {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.properties-list h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.property-card {
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.property-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.property-image-admin {
    width: 100%;
    height: 150px;
    background: #e1e8ed;
    border-radius: 8px;
    margin-bottom: 1rem;
    object-fit: cover;
}

.property-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.property-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

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

.property-action-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.generate-links-btn {
    background: #f39c12;
    color: white;
}

.generate-links-btn:hover {
    background: #e67e22;
}

.view-analytics-btn {
    background: #9b59b6;
    color: white;
}

.view-analytics-btn:hover {
    background: #8e44ad;
}

/* Documents Section */
.documents-overview {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.doc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.doc-stat {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.doc-stat h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 0.5rem;
}

.doc-stat p {
    color: #7f8c8d;
    font-weight: 500;
}

.documents-list {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.documents-list h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.documents-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.table-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.document-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    align-items: center;
    transition: all 0.3s ease;
}

.document-row:hover {
    border-color: #3498db;
    background: #f8fbff;
}

.doc-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}

.doc-status.pending {
    background: #fff3cd;
    color: #856404;
}

.doc-status.signed {
    background: #d4edda;
    color: #155724;
}

.doc-actions {
    display: flex;
    gap: 0.25rem;
}

.doc-action-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn {
    background: #3498db;
    color: white;
}

.download-btn:hover {
    background: #2980b9;
}

.resend-btn {
    background: #f39c12;
    color: white;
}

.resend-btn:hover {
    background: #e67e22;
}

/* Matching Interface */
.matching-controls {
    margin-bottom: 2rem;
}

.match-type-selector {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: fit-content;
}

.match-type-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    background: none;
    color: #7f8c8d;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.match-type-btn.active {
    background: #3498db;
    color: white;
}

.matching-panel {
    display: none;
}

.matching-panel.active {
    display: block;
}

.matching-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.available-properties,
.client-matches {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.available-properties h3,
.client-matches h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.admin-list-item {
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-list-item:hover {
    border-color: #3498db;
    background: #f8fbff;
}

.admin-list-item.selected {
    border-color: #27ae60;
    background: #f0fff4;
}

/* Link Generation Modal */
.link-section {
    margin-bottom: 1.5rem;
}

.link-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.link-box {
    display: flex;
    gap: 0.5rem;
}

.link-box input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    background: #f8f9fa;
    font-family: monospace;
    font-size: 0.9rem;
}

.copy-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #2980b9;
}

.copy-btn.copied {
    background: #27ae60;
}

.link-instructions {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.link-instructions h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.link-instructions ul {
    color: #7f8c8d;
    padding-left: 1.5rem;
}

.link-instructions li {
    margin-bottom: 0.5rem;
}

/* Roommate Groups */
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.roommate-group {
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.roommate-group:hover {
    border-color: #9b59b6;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.1);
}

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

.group-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.compatibility-badge {
    background: #9b59b6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.group-members {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.member-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.member-avatar {
    width: 50px;
    height: 50px;
    background: #9b59b6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin: 0 auto 0.5rem;
}

.member-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.member-details {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* Mobile Admin Optimizations */
@media (max-width: 768px) {
    .admin-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-item {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .admin-section {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .clients-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        max-width: none;
    }
    
    .clients-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .matching-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header,
    .document-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .table-header {
        display: none;
    }
    
    .document-row {
        background: white;
        border: 1px solid #e1e8ed;
        border-radius: 8px;
        padding: 1rem;
    }
    
    .document-row > div {
        margin-bottom: 0.5rem;
    }
    
    .document-row > div:before {
        content: attr(data-label) ': ';
        font-weight: 600;
        color: #2c3e50;
    }
}

/* Loading States */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #7f8c8d;
}

.loading-state .spinner {
    width: 30px;
    height: 30px;
    margin-right: 1rem;
}

/* Empty States */
.empty-state-admin {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.empty-state-admin h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #95a5a6;
}

.empty-state-admin p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.empty-state-admin button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.empty-state-admin button:hover {
    background: #2980b9;
}
