/* =========================================
   3 Dog Photography - Admin Panel Styles
   ========================================= */

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

.login-page {
    background: linear-gradient(135deg, #1a365d, #276749);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Admin Header ===== */
.admin-header {
    background: white;
    border-bottom: 2px solid #e2e8f0;
    padding: .3rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.admin-header .admin-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: #1a365d;
    margin: 0;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-welcome-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.35rem;
    border-top: 1px solid #e2e8f0;
}

.admin-welcome-row span {
    color: #718096;
    font-size: 0.875rem;
    font-weight: 400;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user span {
    color: #4a5568;
    font-weight: 500;
}

.home-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #319795;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.25rem;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-right: 0.35rem;
}

.home-icon:hover {
    background: #2c7a7b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.home-icon:active {
    transform: translateY(0);
}

/* Group home icon with adjacent button visually */
.home-icon + .btn {
    margin-left: -0.5rem;
}

/* Smaller logout button in welcome row */
.admin-welcome-row .btn-danger {
    font-size: 0.8rem;
    padding: 0.2rem 0.3rem;
}

/* ===== Login Box ===== */
.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-box {
    background: white;
    border-radius: 8px;
    padding: 3rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

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

.login-header h1 {
    font-size: 2rem;
    color: #1a365d;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #718096;
}

.login-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2d3748;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Raleway', sans-serif;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #319795;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #718096;
    font-size: 0.875rem;
}

.login-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.login-footer a {
    color: #4a5568;
    text-decoration: none;
    font-size: 0.875rem;
}

.login-footer a:hover {
    color: #319795;
}

/* ===== Admin Dashboard ===== */
.admin-dashboard h2 {
    color: #1a365d;
    margin-bottom: 2rem;
}

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

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-left: 4px solid #319795;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
    font-size: 3rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: #1a365d;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: #718096;
    margin: 0;
}

.dashboard-actions {
    margin-bottom: 3rem;
}

.dashboard-actions h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

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

.action-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.action-card h4 {
    color: #1a365d;
    margin-bottom: 0.5rem;
}

.action-card p {
    color: #718096;
    margin: 0;
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #319795;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== Admin Sections ===== */
.admin-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.admin-section h2 {
    color: #1a365d;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

/* ===== Upload Form ===== */
.upload-form {
    background: #f7fafc;
    padding: 2rem;
    border-radius: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ===== Gallery Grid (Admin) ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.gallery-item-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

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

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-info {
    padding: 1rem;
}

.gallery-item-info strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.help-text {
    text-align: center;
    color: #718096;
    margin-top: 1.5rem;
    font-style: italic;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: #a0aec0;
    font-size: 1.125rem;
}

/* ===== Messages ===== */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.message-card.unread {
    border-left: 4px solid #319795;
    background: #f0fdfa;
}

.message-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.message-type {
    padding: 0.25rem 0.75rem;
    background: #e2e8f0;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #4a5568;
}

.badge-new {
    background: #319795;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.message-date {
    color: #718096;
    font-size: 0.875rem;
}

.message-body {
    color: #2d3748;
}

.message-contact {
    margin-bottom: 1rem;
}

.message-contact p {
    margin-bottom: 0.5rem;
}

.message-contact a {
    color: #319795;
    text-decoration: none;
}

.message-contact a:hover {
    text-decoration: underline;
}

.message-content {
    margin-bottom: 1rem;
}

.inline-form {
    display: inline;
}

/* ===== Content Editor ===== */
.content-editor-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.section-selector {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.section-selector h3 {
    color: #1a365d;
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.page-sections {
    margin-bottom: 2rem;
}

.page-sections h4 {
    color: #4a5568;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.page-sections ul {
    list-style: none;
}

.page-sections li {
    margin-bottom: 0.5rem;
}

.page-sections a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #4a5568;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.page-sections a:hover {
    background: #f7fafc;
    color: #1a365d;
}

.page-sections a.active {
    background: #319795;
    color: white;
}

.content-editor-main {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.editor-header h2 {
    color: #1a365d;
    margin: 0;
}

.editor-mode-toggle {
    display: flex;
    gap: 0.5rem;
}

.editor-mode-toggle .btn.active {
    background: #1a365d;
    color: white;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    color: #1a365d;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #718096;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #2d3748;
}

.modal form {
    padding: 1.5rem;
}

/* ===== Admin Table ===== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.admin-table thead {
    background: #f7fafc;
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table tr:hover {
    background: #f7fafc;
}

.admin-table a {
    color: #319795;
    text-decoration: none;
}

.admin-table a:hover {
    text-decoration: underline;
}

/* ===== Buttons (Admin specific) ===== */
.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .admin-header .admin-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .admin-user {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .content-editor-wrapper {
        grid-template-columns: 1fr;
    }

    .section-selector {
        position: static;
    }

    .login-box {
        padding: 2rem;
    }
}
