/**
 * Dashboard CSS for Rental System
 */

/* Dashboard Container */
.rental-dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Dashboard Header */
.rental-dashboard-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.rental-dashboard-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #333;
}

.rental-dashboard-subtitle {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Filters */
.rental-dashboard-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.rental-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rental-filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.rental-filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.rental-filter-select:hover {
    border-color: #999;
}

.rental-filter-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Loading State */
.rental-dashboard-loading {
    text-align: center;
    padding: 40px;
}

.rental-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: rental-spin 1s linear infinite;
}

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

.rental-dashboard-loading p {
    margin-top: 15px;
    color: #666;
}

/* Messages */
.rental-dashboard-messages {
    margin-bottom: 20px;
}

.rental-notice {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    animation: slideDown 0.3s ease;
}

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

.rental-notice-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.rental-notice-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.rental-notice-icon {
    font-size: 20px;
    font-weight: bold;
}

.rental-notice p {
    margin: 0;
    flex: 1;
}

.rental-notice-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.rental-notice-close:hover {
    opacity: 1;
}

/* Bookings List */
.rental-bookings-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Booking Card */
.rental-booking-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
}

.rental-booking-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.rental-booking-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.rental-booking-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rental-booking-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rental-booking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.rental-booking-title {
    margin: 0;
    font-size: 18px;
    color: #333;
    flex: 1;
    line-height: 1.3;
}

.rental-booking-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.rental-status-active {
    background-color: #d4edda;
    color: #155724;
}

.rental-status-completed {
    background-color: #cce5ff;
    color: #004085;
}

.rental-status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.rental-status-overdue {
    background-color: #fff3cd;
    color: #856404;
}

/* Booking Details */
.rental-booking-details {
    flex: 1;
    margin-bottom: 15px;
}

.rental-booking-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.rental-detail-label {
    color: #666;
    font-weight: 500;
}

.rental-detail-value {
    color: #333;
    font-weight: 600;
    text-align: right;
}

/* Booking Actions */
.rental-booking-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

/* Buttons */
.rental-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.rental-button:hover {
    transform: translateY(-1px);
}

.rental-button:active {
    transform: translateY(0);
}

.rental-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rental-button-cancel {
    background-color: #dc3545;
    color: #fff;
    width: 100%;
}

.rental-button-cancel:hover {
    background-color: #c82333;
}

.rental-button-danger {
    background-color: #dc3545;
    color: #fff;
}

.rental-button-danger:hover {
    background-color: #c82333;
}

.rental-button-secondary {
    background-color: #6c757d;
    color: #fff;
}

.rental-button-secondary:hover {
    background-color: #5a6268;
}

/* Empty State */
.rental-bookings-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.rental-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.rental-bookings-empty h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 22px;
}

.rental-bookings-empty p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Modal */
.rental-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rental-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

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

.rental-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.rental-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
    padding: 0;
    line-height: 1;
}

.rental-modal-close:hover {
    color: #333;
}

.rental-modal-body {
    padding: 25px;
}

.rental-cancel-warning {
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin-bottom: 20px;
    color: #856404;
}

.rental-cancel-warning strong {
    display: block;
    margin-bottom: 5px;
}

.rental-cancel-details {
    margin-bottom: 20px;
}

.rental-cancel-booking-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

.rental-cancel-booking-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #333;
}

.rental-form-group {
    margin-bottom: 15px;
}

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

.rental-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.rental-textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.rental-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.rental-modal-messages {
    margin-top: 15px;
}

.rental-modal-messages .rental-notice {
    margin: 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .rental-dashboard-container {
        padding: 15px;
    }

    .rental-dashboard-header h2 {
        font-size: 24px;
    }

    .rental-dashboard-filters {
        flex-direction: column;
        gap: 15px;
    }

    .rental-filter-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .rental-filter-select {
        width: 100%;
    }

    .rental-bookings-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .rental-booking-card {
        flex-direction: column;
    }

    .rental-booking-image {
        height: 200px;
    }

    .rental-modal-content {
        margin: 10% 15px;
        max-width: none;
    }

    .rental-modal-footer {
        flex-direction: column-reverse;
    }

    .rental-button {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .rental-dashboard-header h2 {
        font-size: 20px;
    }

    .rental-booking-title {
        font-size: 16px;
    }

    .rental-booking-detail {
        font-size: 13px;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .rental-dashboard-container {
        color: #e0e0e0;
    }

    .rental-dashboard-header h2,
    .rental-booking-title,
    .rental-detail-value,
    .rental-cancel-booking-info p {
        color: #e0e0e0;
    }

    .rental-dashboard-subtitle,
    .rental-detail-label {
        color: #b0b0b0;
    }

    .rental-booking-card {
        background: #2a2a2a;
        border-color: #444;
    }

    .rental-modal-content {
        background-color: #2a2a2a;
    }

    .rental-filter-select,
    .rental-textarea {
        background-color: #333;
        color: #e0e0e0;
        border-color: #555;
    }

    .rental-cancel-booking-info {
        background: #333;
    }
}
