/*
* Janja Homes PMS - Frontend Styles
* Version: 1.0.0
*/

/* Reset and Base Styles */
.janja-homes-pms * {
    box-sizing: border-box;
}

.janja-homes-pms {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Dashboard Styles */
.janja-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #0055BD 0%, #003d8f 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 85, 189, 0.15);
}

.welcome-section h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.dashboard-date {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
}

/* Navigation */
.dashboard-nav {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.nav-menu {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
}

.nav-menu li {
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: #0055BD;
    background: rgba(0, 85, 189, 0.05);
    border-bottom-color: #0055BD;
}

.nav-link i {
    margin-right: 8px;
    font-size: 16px;
}

/* Widgets Grid */
.widgets-grid,
.tenant-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.widget-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.widget-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #f5f5f5;
    color: #333;
}

.widget-content {
    padding: 20px;
}

/* Stats Cards */
.stats-grid,
.agent-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

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

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.building,
.stat-icon.users,
.stat-icon.dollar,
.stat-icon.percentage,
.stat-icon.wrench { background: linear-gradient(135deg, #0055BD 0%, #003d8f 100%) !important; }

.stat-info {
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #0055BD, #003d8f);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 85, 189, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Property Search */
.janja-property-search {
    max-width: 1200px;
    margin: 0 auto;
}

.search-filters {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: center;
}

.form-row input,
.form-row select {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #0055BD;
    box-shadow: 0 0 0 3px rgba(0, 85, 189, 0.1);
}

.search-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #0055BD, #003d8f);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 85, 189, 0.4);
}

/* Properties Grid */
.properties-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 30px;
}

.properties-grid.columns-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.properties-grid.columns-3 {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

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

.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.property-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

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

.property-info {
    padding: 20px;
}

.property-info h3,
.property-info h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.property-info h3 a,
.property-info h4 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.property-info h3 a:hover,
.property-info h4 a:hover {
    color: #0055BD;
}

.property-location {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

.property-details {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.property-details span {
    font-size: 13px;
    color: #666;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.property-rent {
    font-size: 20px;
    font-weight: 700;
    color: #0055BD;
    margin-bottom: 16px;
}

.view-property {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #0055BD;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.view-property:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Forms */
.janja-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0055BD;
    box-shadow: 0 0 0 3px rgba(0, 85, 189, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    gap: 20px;
}

.form-row.two-columns {
    grid-template-columns: 1fr 1fr;
}

.form-row.three-columns {
    grid-template-columns: 1fr 1fr 1fr;
}

/* OAuth Buttons */
.janja-oauth-buttons {
    margin: 20px 0;
}

.oauth-separator {
    text-align: center;
    margin: 20px 0 16px;
    color: #666;
    font-size: 14px;
}

.oauth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 10px;
}

.oauth-button:hover {
    border-color: #ccc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.oauth-button.google-oauth:hover {
    border-color: #4285f4;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
}

.oauth-button.facebook-oauth:hover {
    border-color: #1877f2;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.2);
}

.oauth-icon {
    width: 20px;
    height: 20px;
}

/* Messages Interface */
.messaging-interface {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.messaging-interface.open {
    transform: translateY(0);
}

.messaging-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #0055BD, #003d8f);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messaging-content {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.message-item {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    max-width: 80%;
}

.message-item.sent {
    background: #0055BD;
    color: white;
    margin-left: auto;
}

.message-item.received {
    background: #f8f9fa;
    color: #333;
}

.message-input {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.message-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.message-input button {
    padding: 10px 20px;
    background: #0055BD;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
}

/* Loading States */
.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-spinner:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #0055BD;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination-links {
    display: flex;
    gap: 5px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none;
    color: #666;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-link:hover,
.page-link.active {
    background: #0055BD;
    color: white;
    border-color: #0055BD;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-link {
        justify-content: center;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .nav-link.active {
        border-left-color: #0055BD;
        border-bottom-color: transparent;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-row.two-columns,
    .form-row.three-columns {
        grid-template-columns: 1fr;
    }
    
    .stats-grid,
    .widgets-grid,
    .properties-grid {
        grid-template-columns: 1fr;
    }
    
    .messaging-interface {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .janja-dashboard {
        padding: 10px;
    }
    
    .dashboard-header {
        padding: 15px;
    }
    
    .widget-content,
    .stat-card {
        padding: 15px;
    }
    
    .property-info {
        padding: 15px;
    }
}