/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #ffffff;
    color: #333;
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* ============================================
   MOBILE-FIRST NAVIGATION
   ============================================ */

/* Navigation Container */
.nav {
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Brand/Logo */
.nav-brand {
    font-weight: 600;
    font-size: 18px;
    color: #007bff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand:hover {
    color: #0056b3;
}

/* Mobile Menu Toggle Button */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 20px;
    color: #495057;
    background: white;
    line-height: 1;
}

.nav-toggle:hover {
    background: #e9ecef;
}

/* Navigation Links Container */
.nav-links {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #495057;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-links a:hover {
    background: #e9ecef;
    color: #000;
}

.nav-links a.active {
    background: #007bff;
    color: #fff;
}

.nav-links a.active:hover {
    background: #0056b3;
}

/* Right side items (user info, logout) */
.nav-right {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.nav-user {
    color: #6c757d;
    font-size: 14px;
    padding: 8px 10px;
    white-space: nowrap;
}

.nav-divider {
    color: #dee2e6;
    padding: 0 5px;
}

/* ============================================
   RESPONSIVE - TABLETS AND MOBILE
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    /* Show toggle button on mobile */
    .nav-toggle {
        display: block;
        order: 1;
    }

    .nav-brand {
        order: 0;
        font-size: 16px;
    }

    .nav-right {
        order: 2;
        margin-left: auto;
    }

    .nav-user {
        font-size: 13px;
        padding: 6px 8px;
    }

    /* Hide links by default on mobile */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 3;
        padding-top: 10px;
        border-top: 1px solid #e9ecef;
        margin-top: 10px;
        gap: 2px;
    }

    /* Show links when menu is open */
    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 10px 14px;
        font-size: 15px;
    }

    .nav-links a:hover {
        background: #e9ecef;
    }

    /* Adjust right section on mobile */
    .nav-right {
        gap: 3px;
    }

    .nav-divider {
        display: none;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .nav {
        padding: 8px 12px;
        border-radius: 6px;
    }

    .nav-brand {
        font-size: 15px;
    }

    .nav-user {
        font-size: 12px;
        padding: 4px 6px;
    }

    .nav-toggle {
        font-size: 18px;
        padding: 4px 8px;
    }

    .nav-links a {
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* ============================================
   REST OF YOUR STYLES (Keep existing)
   ============================================ */

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input[type="file"] {
    border: 2px dashed #dee2e6;
    padding: 20px;
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: #0056b3;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.photo-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    background: #f8f9fa;
}

.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.photo-card .thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f1f3f5;
}

.photo-card .info {
    padding: 12px;
    font-size: 14px;
}

.photo-card .info .filename {
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-card .info .meta {
    color: #6c757d;
    font-size: 12px;
}

/* Action Buttons */
.photo-card .actions {
    padding: 8px 12px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.photo-card .actions .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    color: #495057;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: inherit;
    min-width: 32px;
    height: 32px;
}

.photo-card .actions .btn-action:hover {
    background: #f8f9fa;
    border-color: #ced4da;
}

.photo-card .actions .btn-action.view {
    color: #007bff;
    border-color: #b8d4f0;
}

.photo-card .actions .btn-action.view:hover {
    background: #e7f1ff;
    border-color: #007bff;
}

.photo-card .actions .btn-action.download {
    color: #28a745;
    border-color: #b8e0c4;
}

.photo-card .actions .btn-action.download:hover {
    background: #e6f9ed;
    border-color: #28a745;
}

.photo-card .actions .btn-action.delete {
    color: #dc3545;
    border-color: #f5c6cb;
    font-weight: bold;
    font-size: 16px;
}

.photo-card .actions .btn-action.delete:hover {
    background: #fde8ea;
    border-color: #dc3545;
    transform: scale(1.1);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #dee2e6;
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 30px;
}

.upload-zone.dragover {
    border-color: #007bff;
    background: #e7f1ff;
}

/* Messages */
.message {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Gallery View */
.gallery-header {
    margin-bottom: 20px;
}

.gallery-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

/* View Page */
.photo-view {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.photo-view img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.photo-view .details {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

.photo-view .details p {
    margin-bottom: 8px;
}

/* ============================================
   RESPONSIVE GRID FOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .photo-card .thumbnail {
        height: 150px;
    }
    
    .upload-zone {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .photo-card .thumbnail {
        height: 120px;
    }
    
    .photo-card .info {
        padding: 8px;
        font-size: 12px;
    }
    
    .photo-card .info .meta {
        font-size: 10px;
    }
    
    .photo-card .actions {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .photo-card .actions .btn-action {
        padding: 3px 6px;
        font-size: 11px;
        min-width: 24px;
        height: 24px;
    }
}