/* Admin Interface Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-branding {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    height: 80px;
    width: auto;
    display: block;
    margin: 0 auto 15px auto;
}

.login-brand-name {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.login-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-logo {
    height: 60px;
    width: auto;
    display: block;
}

.admin-brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #2c3e50;
    margin-bottom: 4px;
}

header h1 {
    color: #2c3e50;
    font-size: 24px;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

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

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-group input[type="file"] {
    margin-top: 5px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

button, .btn-primary, .btn-secondary, .btn-small, .btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

button, .btn-primary {
    background-color: #3498db;
    color: white;
}

button:hover, .btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
    margin-left: 10px;
}

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

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
    margin-right: 5px;
}

.actions {
    margin-bottom: 20px;
}

.error {
    background-color: #fee;
    border: 1px solid #e74c3c;
    color: #c0392b;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.no-data {
    background: white;
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    color: #999;
}

/* Property Table */
.property-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.property-table th,
.property-table td {
    padding: 15px;
    text-align: left;
}

.property-table thead {
    background-color: #34495e;
    color: white;
}

.property-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

.property-table tbody tr:hover {
    background-color: #f8f9fa;
}

.status-active {
    color: #27ae60;
    font-weight: 600;
}

.status-inactive {
    color: #e74c3c;
    font-weight: 600;
}

.actions-cell {
    white-space: nowrap;
}

/* Forms */
.property-form, .point-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* Points Section */
.points-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.points-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.points-list {
    margin-top: 20px;
}

.point-card {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.point-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.point-header h3 {
    color: #2c3e50;
    font-size: 18px;
}

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

.point-actions form {
    display: inline;
}

.point-card p {
    margin-bottom: 10px;
    color: #555;
}

.point-thumbnail {
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    margin-top: 10px;
}

.current-photo {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.current-photo img {
    display: block;
    margin: 10px 0;
    border-radius: 4px;
}

/* QR Code Page */
.qrcode-page .qrcode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.qrcode-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.qrcode-item h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.qrcode-item img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
}

.qr-url {
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

hr {
    margin: 40px 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* ============================================================================
   MOBILE RESPONSIVE STYLES
   ============================================================================ */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    .admin-container {
        padding: 15px;
    }

    /* Header improvements */
    header {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }

    .header-logo-title {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .admin-logo {
        height: 50px;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .header-actions > div {
        text-align: center !important;
    }

    /* Make all buttons full-width on mobile */
    .btn-primary, .btn-secondary, .btn-danger, button {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        font-size: 16px;
    }

    .btn-small {
        width: auto;
        padding: 8px 12px;
        font-size: 14px;
    }

    /* Table responsiveness - convert to card layout */
    .property-table {
        border: 0;
    }

    .property-table thead {
        display: none;
    }

    .property-table tbody {
        display: block;
    }

    .property-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        background: white;
    }

    .property-table td {
        display: block;
        text-align: left;
        padding: 10px 5px;
        border-bottom: 1px solid #f0f0f0;
    }

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

    /* Add labels to table cells on mobile */
    .property-table td:before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        margin-bottom: 5px;
        color: #2c3e50;
    }

    .actions-cell {
        white-space: normal;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .actions-cell .btn-small {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
        text-align: center;
    }

    /* Forms */
    .property-form, .point-form, .points-section {
        padding: 20px 15px;
    }

    /* Point cards */
    .point-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .point-actions {
        width: 100%;
        flex-direction: column;
    }

    .point-actions .btn-small {
        width: 100%;
    }

    /* QR Code grid */
    .qrcode-page .qrcode-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Login container */
    .login-container {
        margin: 50px 20px;
        padding: 30px 20px;
    }

    /* Handle inline flex displays in templates */
    [style*="display: flex"][style*="gap:"] {
        flex-wrap: wrap !important;
    }

    /* Responsive stat cards (super admin dashboard) */
    [style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* Inline forms should stack on mobile */
    form[style*="display: inline-flex"] {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    form[style*="display: inline-flex"] select,
    form[style*="display: inline-flex"] input {
        width: 100% !important;
    }
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    header h1 {
        font-size: 20px;
    }

    .admin-brand {
        font-size: 18px;
    }

    .form-group input[type="text"],
    .form-group input[type="password"],
    .form-group input[type="email"],
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Ensure touch targets are at least 44x44px */
    button, .btn-primary, .btn-secondary, .btn-danger {
        min-height: 44px;
    }

    .btn-small {
        min-height: 36px;
        padding: 8px 12px;
    }

    /* Better spacing for mobile */
    .form-group {
        margin-bottom: 15px;
    }

    .admin-container {
        padding: 10px;
    }

    header {
        padding: 12px;
        margin-bottom: 20px;
    }

    /* Improve readability on small screens */
    .property-table td {
        font-size: 14px;
    }

    .point-card {
        padding: 15px;
    }

    /* Audio player improvements for mobile */
    audio {
        height: 60px !important;
        min-height: 60px !important;
    }

    audio::-webkit-media-controls-panel {
        height: 60px;
        min-height: 60px;
    }

    audio::-webkit-media-controls-play-button {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }
}
