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

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #e9e9e9;
    --accent-color: #FFD700;
    --card-bg: rgba(30,30,50,0.8);
    --font-heading: 'Amiri', serif;
    --font-body: 'Tajawal', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-secondary);
}

body {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    color: var(--text-primary);
    direction: rtl;
    overflow-x: hidden;
}

#app {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding-bottom: 70px;
}

.side-menu {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 250px;
    background: rgba(22, 33, 62, 0.9);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.side-menu.open {
    transform: translateX(0);
}

.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 30px;
    height: 25px;
    cursor: pointer;
    z-index: 200;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.menu-items {
    list-style: none;
    padding: 50px 20px;
}

.menu-items li {
    margin-bottom: 15px;
}

.menu-items a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.menu-items a:hover, .menu-items a.active {
    color: var(--accent-color);
}

header {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    padding: 20px 15px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    margin-bottom: 20px;
}

header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--accent-color);
    text-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

header p {
    font-size: 1rem;
    color: var(--text-primary);
    opacity: 0.7;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.search-container input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border-radius: 25px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-container i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
}

#recipe-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 15px;
    perspective: 1000px;
}

.recipe-card {
    position: relative;
    height: 250px;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 
        0 10px 20px rgba(0,0,0,0.3),
        0 15px 25px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom center;
    transform-style: preserve-3d;
}

.recipe-card:hover {
    transform: scale(1.02) translateY(-20px);
    z-index: 10;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.4),
        0 25px 50px rgba(0,0,0,0.3);
}

.recipe-card::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 10px;
    right: 10px;
    height: 10px;
    background: rgba(0,0,0,0.1);
    border-radius: 0 0 15px 15px;
    transform: scaleX(0.9);
    z-index: -1;
}

.recipe-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recipe-card:hover .recipe-card-image {
    transform: scale(1.1);
}

.recipe-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 15px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: background 0.3s ease;
}

.recipe-card:hover .recipe-card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.recipe-card-title {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    padding: 0 10px;
}

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

@keyframes softBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#recipe-details {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-primary), #2c2c2c);
    z-index: 20;
    overflow-y: auto;
    padding: 15px;
    animation: slideIn 0.5s ease-out;
}

#recipe-details.hidden {
    display: none;
}

.recipe-details-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.recipe-details-image-container {
    width: 100%;
    height: 300px;
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.recipe-details-image-container:hover {
    transform: scale(1.05);
}

.recipe-details-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-section {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 15px;
    margin-bottom: 15px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideIn 0.5s ease-out forwards;
    animation-delay: 0.3s;
}

.recipe-section:nth-child(2) {
    animation-delay: 0.4s;
}

.recipe-section:nth-child(3) {
    animation-delay: 0.5s;
}

.recipe-section-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: white;
}

.recipe-section-content {
    color: rgba(255,255,255,0.9);
}

.recipe-section-content li {
    margin-right: 20px;
    margin-bottom: 10px;
}

.details-header {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
}

.back-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255,215,0,0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    z-index: 30;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,215,0,0.3);
    animation: softBounce 2s infinite;
}

.share-button {
    position: fixed;
    bottom: 90px;
    left: 20px;
    background: rgba(255,215,0,0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    z-index: 30;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,215,0,0.3);
    animation: softBounce 2s infinite;
}

.back-button:hover, .share-button:hover {
    background: rgba(255,215,0,0.3);
    transform: scale(1.1);
}

.back-button:active, .share-button:active {
    transform: scale(0.9);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(22, 33, 62, 0.9);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    backdrop-filter: blur(10px);
    z-index: 50;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.bottom-nav-btn {
    background: rgba(255,215,0,0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.bottom-nav-btn:hover {
    background: rgba(255,215,0,0.3);
    transform: scale(1.1);
}

.bottom-nav-btn:active {
    transform: scale(0.9);
}

/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay:not(.hidden) .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.modal-message {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-button {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.modal-button.primary {
    background: var(--accent-color);
    color: var(--bg-primary);
}

.modal-button.secondary {
    background: rgba(255,255,255,0.15);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.3);
}

.modal-button.primary:hover {
    background: #e6c200;
    transform: translateY(-2px);
}

.modal-button.secondary:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.modal-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* New styles for the share modal specific elements */
.share-url-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.share-url-input {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 25px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: right; /* For RTL */
    direction: rtl; /* For RTL */
    outline: none;
}

.share-url-input:focus {
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* Custom Notification Styles */
.copy-notification {
    position: fixed;
    bottom: 80px; /* Adjust based on bottom nav height */
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: var(--bg-primary);
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, visibility 0.4s ease-out;
}

.copy-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-20px); /* Slightly move up */
}

.copy-notification i {
    font-size: 1.2rem;
}