@import url('https://fonts.googleapis.com/css2?family=Mada:wght@300;400;700;900&display=swap');

/* Global Styles */
body {
    margin: 0;
    font-family: 'Mada', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #FFE610 0%, #FFC940 100%);
    color: #111;
    direction: ltr;
    transition: all 0.3s ease;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 50px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.6s ease-out;
    border-radius: 20px;
}

/* Top-right container to hold main nav and language controls */
.top-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Main navigation (page links) */
.main-nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    display: inline-block;
    padding: 10px 18px;
    background: linear-gradient(135deg, #111 0%, #333 100%);
    color: #FFE610;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    background: linear-gradient(135deg, #222 0%, #444 100%);
}

.lang-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

.logo {
    height: 80px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
    border-radius: 12px;
}

.logo:hover {
    transform: scale(1.05);
}

/* Language Buttons */
.lang-btn {
    background: linear-gradient(135deg, #111 0%, #333 100%);
    color: #FFE610;
    padding: 12px 24px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    margin-left: 12px;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    letter-spacing: 1px;
}

.lang-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #222 0%, #444 100%);
}

.lang-btn:active {
    transform: translateY(0);
}

/* Sections */
main {
    max-width: 1000px;
    margin: 40px auto;
    padding: 40px;
}

section {
    margin-bottom: 60px;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

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

.section-title {
    font-size: 32px;
    color: #111;
    background: linear-gradient(135deg, #111 0%, #333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 15px;
    margin-bottom: 25px;
    position: relative;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #FFE610 0%, #FFC940 100%);
    border-radius: 2px;
}

.section-text {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

/* Delete Form */
#delete-form {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 35px;
    border-radius: 15px;
    color: #FFE610;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

#delete-form label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

#delete-form input,
#delete-form textarea {
    padding: 14px 16px;
    border-radius: 10px;
    border: 2px solid transparent;
    width: 100%;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    box-sizing: border-box;
}

#delete-form input:focus,
#delete-form textarea:focus {
    outline: none;
    border-color: #FFE610;
    box-shadow: 0 0 0 3px rgba(255, 230, 16, 0.2);
    transform: translateY(-2px);
}

#delete-form textarea {
    resize: vertical;
    min-height: 100px;
}

#delete-form button {
    padding: 16px;
    background: linear-gradient(135deg, #FFE610 0%, #FFC940 100%);
    color: #111;
    border: none;
    font-weight: bold;
    cursor: pointer;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 230, 16, 0.3);
    letter-spacing: 1px;
    text-transform: uppercase;
}

#delete-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 230, 16, 0.4);
    background: linear-gradient(135deg, #FFC940 0%, #FFE610 100%);
}

#delete-form button:active {
    transform: translateY(0);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    margin-top: 60px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
}

footer p {
    margin: 0;
    color: #333;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* RTL Mode */
.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .lang-btn {
    margin-left: 0;
    margin-right: 12px;
}

.rtl .section-title::after {
    left: auto;
    right: 0;
}

/* List Styles */
ul.section-text {
    padding-left: 0;
    list-style: none;
}

ul.section-text li {
    padding-left: 30px;
    position: relative;
    margin-bottom: 15px;
}

ul.section-text li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #FFE610;
    background: linear-gradient(135deg, #111 0%, #333 100%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.rtl ul.section-text li {
    padding-left: 0;
    padding-right: 30px;
}

.rtl ul.section-text li::before {
    left: auto;
    right: 0;
}

/* Section Animation States */
.section-hidden {
    opacity: 0;
    transform: translateY(30px);
}

.section-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }
    
    .logo {
        height: 50px;
    }
    
    .top-right {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        margin-top: 12px;
    }
    
    .main-nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .nav-btn {
        padding: 8px 14px;
        font-size: 13px;
        flex: 1 1 calc(50% - 8px);
        min-width: 140px;
        text-align: center;
    }
    
    .lang-nav {
        justify-content: center;
        width: 100%;
    }
    
    .lang-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    main {
        padding: 15px;
        margin: 15px auto;
    }
    
    section {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-text {
        font-size: 15px;
    }
    
    .gallery-item {
        flex: 0 0 75%;
        min-width: 70%;
    }
}

/* Horizontal gallery row with card-style items */
.gallery-grid {
    display: flex;
    gap: 18px;
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.gallery-wrap {
    position: relative;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(17,17,17,0.85);
    color: #FFE610;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 50;
    transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
    opacity: 0.6; /* semi-transparent until hover */
}

.gallery-nav:hover,
.gallery-nav:focus {
    opacity: 1;
    transform: translateY(-50%) translateY(-6px) scale(1.03);
    box-shadow: 0 12px 36px rgba(0,0,0,0.32);
}

/* Use CSS pseudo-elements for arrow glyphs so language switching won't replace them */
.gallery-prev::before,
.gallery-next::before {
    display: block;
    color: #FFE610;
    font-size: 22px;
    line-height: 1;
}
.gallery-prev::before { content: '‹'; }
.gallery-next::before { content: '›'; }

/* Flip arrows when RTL is active (body gets .rtl or html dir attribute set) */
.rtl .gallery-prev::before,
html[dir="rtl"] .gallery-prev::before {
    content: '›';
}

.rtl .gallery-next::before,
html[dir="rtl"] .gallery-next::before {
    content: '‹';
}

.gallery-prev { left: -22px; }
.gallery-next { right: -22px; }

.gallery-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

/* hide nav on small screens where swiping is easier */
@media (max-width: 600px) {
    .gallery-nav { display: none; }
    .gallery-prev { left: 6px; }
    .gallery-next { right: 6px; }
}

.gallery-item {
    flex: 0 0 320px;
    min-width: 260px;
    background: rgba(255,255,255,0.95);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    scroll-snap-align: start;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 60px rgba(0,0,0,0.16);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: contain;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    padding: 24px;
}

.lightbox.open { display: flex; }

.lightbox-img {
    max-width: 92%;
    max-height: 78vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.lightbox-caption {
    color: #fff;
    margin-top: 12px;
    text-align: center;
    font-size: 16px;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: transparent;
    color: #fff;
    font-size: 28px;
    border: none;
    cursor: pointer;
}

@media (max-width: 480px) {
    header {
        padding: 12px 15px;
    }
    
    .logo {
        height: 45px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 120px;
    }
    
    .lang-btn {
        padding: 8px 18px;
        font-size: 12px;
    }
    
    main {
        padding: 12px;
    }
    
    section {
        padding: 18px;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .section-text {
        font-size: 14px;
    }
    
    .gallery-item {
        flex: 0 0 85%;
        min-width: 80%;
    }
    
    .lightbox-img {
        max-height: 70vh;
    }
    
    #delete-form {
        padding: 25px;
    }
    
    #delete-form label {
        font-size: 13px;
    }
    
    #delete-form input,
    #delete-form textarea {
        font-size: 14px;
        padding: 12px;
    }
}

/* Salon Registration Form */
.salon-form {
    max-width: 800px;
    margin: 0 auto;
}

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

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

.rtl .form-group label {
    text-align: right;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Mada', sans-serif;
    transition: border-color 0.3s;
    box-sizing: border-box;
    background-color: white;
}

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

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B4513' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

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

.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Mada', sans-serif;
    background: #f9f9f9;
}

.form-group input[type="file"]:hover {
    border-color: #8B4513;
    background: #fff;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}

.rtl .form-hint {
    text-align: right;
}

/* Image Preview */
.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
    background: #f5f5f5;
}

.preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.3s;
}

.preview-remove:hover {
    background: rgba(255, 0, 0, 1);
}

.rtl .preview-remove {
    right: auto;
    left: 6px;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: #8B4513;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    font-family: 'Mada', sans-serif;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #6d3410;
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Form Status */
.form-status {
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.form-status.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-status.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-status.loading {
    display: block;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Mobile Responsive for Salon Form */
@media (max-width: 600px) {
    .form-group label {
        font-size: 14px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .form-group select {
        padding-right: 35px;
        background-size: 18px;
    }
    
    .image-preview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .preview-item img {
        height: 120px;
    }
    
    .submit-btn {
        font-size: 16px;
        padding: 14px;
    }
}
