/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Default Theme Variables */
:root {
    --primary-color: #F39C12;
    --background-color: #f4f4f9;
    --text-color: #333;
    --quote-background: linear-gradient(135deg, #fff5e6, #ffe6cc);
    --quote-border: #f0c27b;
    --quote-shadow: rgba(240, 194, 123, 0.2);
    --quote-hover-shadow: rgba(240, 194, 123, 0.3);
    --search-background: rgba(255, 255, 255, 0.9);
}

/* Silver Theme */
body.silver-theme {
    --primary-color: #757575;
    --background-color: #f5f5f5;
    --text-color: #2c3e50;
    --quote-background: linear-gradient(135deg, #ffffff, #f0f0f0);
    --quote-border: #d1d1d1;
    --quote-shadow: rgba(0, 0, 0, 0.1);
    --quote-hover-shadow: rgba(0, 0, 0, 0.15);
    --search-background: rgba(255, 255, 255, 0.95);
}

/* Black Theme */
body.black-theme {
    --primary-color: #bb86fc;
    --background-color: #121212;
    --text-color: #e0e0e0;
    --quote-background: linear-gradient(135deg, #1e1e1e, #2d2d2d);
    --quote-border: #333;
    --quote-shadow: rgba(0, 0, 0, 0.3);
    --quote-hover-shadow: rgba(187, 134, 252, 0.1);
    --search-background: rgba(30, 30, 30, 0.95);
}

/* Body */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Quotes */
.quotes-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

/* Enhanced Quote Styles */
.quote {
    background: var(--quote-background);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--quote-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid var(--quote-border);
}

.quote:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 25px var(--quote-hover-shadow);
}

.quote-text {
    font-size: 1.4em; /* Increase font size */
    line-height: 1.6;
    color: var(--quote-text-color);   /* Darker grey for better readability */
    font-style: italic;
    font-weight: 500;
    position: relative;
}

.quote-author {
    font-size: 1.1em;
    color: var(--quote-author-color);
    font-weight: 600;
    text-align: right;
}

.quote-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    background: var(--tag-background); /* Warmer background color */
    color: var(--tag-color);         /* White text for contrast */
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    transition: background 0.3s ease, transform 0.2s;
    cursor: pointer;
}

.tag:hover {
    background: #e0ac69;
    transform: translateY(-2px);
}

.quote-category {
    font-size: 0.9em;
    color: #888;
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Enhanced Search Controls */
.search-controls {
    display: flex;
    gap: 20px;
    margin: 30px auto 40px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 800px;
    padding: 20px;
    background: var(--search-background);
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.search-controls:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.search-bar {
    flex: 1;
    padding: 15px 25px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 16px;
    min-width: 300px;
    background: #fff;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
}

.search-bar:focus {
    border-color: #F39C12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
    outline: none;
}

.search-bar::placeholder {
    color: #aaa;
    transition: color 0.3s ease;
}

.search-bar:focus::placeholder {
    color: #F39C12;
}

.filter-select {
    padding: 15px 30px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 16px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23F39C12' 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") no-repeat right 15px center;
    background-size: 15px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    min-width: 200px;
    transition: all 0.3s ease;
}

.filter-select:focus {
    border-color: #F39C12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
    outline: none;
}

.filter-select:hover {
    border-color: #F39C12;
    background-color: #fff;
}

.category-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 auto 40px;
    max-width: 900px;
    padding: 10px;
}

.category-filter {
    padding: 10px 20px;
    border: 2px solid #F39C12;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #666;
    min-width: 100px;
    text-align: center;
}

.category-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.2);
    color: #F39C12;
}

.category-filter.active {
    background: #F39C12;
    color: white;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

/* Search Controls */
.search-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.search-bar {
    padding: 12px 20px;
    border: 2px solid #F39C12;
    border-radius: 25px;
    width: 300px;
    font-size: 16px;
    outline: none;
    transition: box-shadow 0.3s ease;
}

.search-bar:focus {
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

.filter-select {
    padding: 12px 20px;
    border: 2px solid #F39C12;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

.filter-select:hover {
    background-color: #fff5e6;
}

.category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 30px;
}

.category-filter {
    padding: 8px 16px;
    border: 2px solid #F39C12;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-size: 14px;
}

.category-filter:hover {
    background: #fff5e6;
}

.category-filter.active {
    background: #F39C12;
    color: white;
}

/* Section */
.section {
    padding: 140px 80px 40px;
    text-align: center;
    background: linear-gradient(135deg, #f4f4f9, #e2e2e6);
    transition: background-color 0.5s ease;
}

.section-title {
    font-size: 40px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    width: 40px;
    height: 4px;
    background-color: #F39C12;
    transform: translateX(-50%);
}

/* Header */
.navigation {
    background: linear-gradient(90deg, #151515, #292929);
    color: #fafafa;
    padding: 20px 40px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 2px solid #F39C12;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.navigation .logo {
    display: flex;
    align-items: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.navigation .logo img {
    margin-right: 15px;
    width: 45px;
    height: 45px;
    transition: transform 0.3s;
}

.navigation .items {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-grow: 2;
    justify-content: end;
}

.navigation .item {
    font-size: 18px;
    font-weight: 500;
    color: #fafafa;
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
}

.navigation .item:hover {
    color: #F39C12;
    transform: translateY(-3px);
}

.navigation .button {
    padding: 12px 26px;
    background-color: #F39C12;
    color: white;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: background 0.3s, transform 0.2s;
}

.navigation .button.secondary {
    background-color: transparent;
    color: #fafafa;
    border: 2px solid #F39C12;
}

.navigation .button.secondary:hover {
    background-color: #F39C12;
    color: white;
}

/* Profile Styles */
.profile-container {
    position: relative;
    display: inline-block;
}

.profile-photo {
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    display: none;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.profile-photo.visible {
    display: block;
    opacity: 1;
}

#loginBtn {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#loginBtn.visible {
    display: inline-block;
    opacity: 1;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background-color: white;
    min-width: 200px;
    padding: 8px 0;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
}

.user-info {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.user-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.user-email {
    font-size: 0.9em;
    color: #666;
}

.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.dropdown-menu button i {
    width: 16px;
    text-align: center;
}

.dropdown-menu button:hover {
    background-color: #f1f1f1;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1000;
}

.toast.success {
    background: #4CAF50;
}

.toast.show {
    opacity: 1;
}

/* Footer */
.footer {
    background-color: #151515;
    color: #fafafa;
    padding: 70px 20px;
    position: relative;
    bottom: 0px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: auto;
    z-index: 1000;
    box-sizing: border-box;
}

.footer .logo {
    display: flex;
    align-items: center;
    font-size: 28px;
    font-weight: 700;
}

.footer .logo img {
    margin-right: 12px;
    width: 45px;
    height: 45px;
}

.footer .items {
    display: flex;
    gap: 48px;
}

.footer .item {
    font-size: 18px;
    font-weight: 500;
    color: #fafafa;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
}

.footer .item:hover {
    color: #F39C12;
    transform: translateY(-2px);
}

/* Style the theme selector */
.theme-selector {
    position: relative;
    margin-left: 20px;
    padding: 8px;
    background: var(--search-background);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--quote-shadow);
}

.theme-selector label {
    color: var(--text-color);
    margin-right: 10px;
    font-weight: 500;
}

.theme-selector select {
    padding: 8px 30px 8px 15px;
    border: 1px solid var(--quote-border);
    border-radius: 6px;
    background: var(--quote-background);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.theme-selector select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--quote-shadow);
}

.theme-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--quote-shadow);
}

/* Updated Watermark Styles */
.watermark {
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 1.2em;   /* Slightly increased font size */
    font-style: normal;
    font-weight: 500;
    color: var(--primary-color);
    opacity: 0.7;
    letter-spacing: 1px;
    transform: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    z-index: 1;
    text-align: right;    /* Added to align with author */
    margin-top: 10px;  /* Increased spacing */
    display: block;    /* Changed to block */
    position: relative; /* Changed to relative */
    padding-top: 5px; /* Added padding */
    border-top: 1px solid var(--quote-border); /* Added separator */
}

/* Watermark hover effect */
.quote:hover .watermark {
    opacity: 1;
    transform: rotate(0deg) scale(1.05);
}

/* Enhanced watermark for different themes */
body.silver-theme .watermark {
    background: linear-gradient(45deg, #757575, #999);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border-top-color: #757575;
    font-weight: 700;
}

body.black-theme .watermark {
    background: linear-gradient(45deg, #bb86fc, #9d65ed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border-top-color: #bb86fc;
    font-weight: 700;
    text-shadow: 
        0 1px 2px rgba(0,0,0,0.2),
        0 0 15px rgba(187, 134, 252, 0.4);
}

/* Make watermark more prominent on hover */
.quote:hover .watermark {
    opacity: 1;
    transform: scale(1.05);
    transition: all 0.3s ease;
}

/* Share Button Styles */
.share-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    transition: all 0.3s ease;
    align-self: flex-end;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--quote-shadow);
    background-color: var(--primary-color);
    opacity: 0.9;
}

.share-button i {
    font-size: 16px;
}

/* Share Quote Styles */
.share-quote {
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
}

.share-decorator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #F39C12, #E67E22, #D35400);
    border-radius: 15px 15px 0 0;
}

.share-quote::before {
    content: '❝';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 60px;
    color: rgba(243, 156, 18, 0.2);
    font-family: serif;
    line-height: 1;
}

.share-quote::after {
    content: '❞';
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 60px;
    color: rgba(243, 156, 18, 0.2);
    font-family: serif;
    line-height: 1;
}

.quote-marks {
    font-family: Georgia, serif;
    font-size: 1.5em;
    color: #F39C12;
    opacity: 0.8;
    line-height: 0;
    vertical-align: middle;
}

/* Share Menu Styles */
.share-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.share-menu-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    animation: slideUp 0.3s ease;
}

.share-menu h3 {
    margin: 0 0 15px;
    text-align: center;
    color: #333;
    font-size: 1.2em;
}

.share-option {
    width: 100%;
    padding: 15px;
    margin: 5px 0;
    border: none;
    background: none;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-radius: 10px;
    transition: background-color 0.3s;
}

.share-option:hover {
    background-color: #f5f5f5;
}

.share-option.whatsapp {
    color: #25D366;
}

.share-option.download {
    color: #333;
}

.share-option.cancel {
    color: #666;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .section {
        padding: 80px 20px;
    }

    .navigation .items {
        display: none;
    }

    .navigation.active .items {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: #292929;
        padding: 20px 0;
        gap: 16px;
        z-index: 99;
    }

    .footer .items {
        flex-direction: column;
        gap: 16px;
    }

    .footer {
        flex-direction: column;
        gap: 20px;
    }

    .quote {
        padding: 20px;
    }

    .quote-text {
        font-size: 1.1em;
    }

    .quote-tags {
        gap: 6px;
    }

    .tag {
        padding: 3px 10px;
        font-size: 0.8em;
    }

    .search-controls {
        padding: 15px;
        margin: 20px 15px 30px;
        flex-direction: column;
    }

    .search-bar,
    .filter-select {
        width: 100%;
        min-width: unset;
    }

    .category-filters {
        padding: 5px 15px;
        gap: 8px;
    }

    .category-filter {
        padding: 8px 16px;
        min-width: 80px;
        font-size: 14px;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 576px) {
    .navigation {
        padding: 15px 20px;
    }

    .navigation .logo {
        font-size: 22px;
    }

    .navigation .logo img {
        width: 35px;
        height: 35px;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
    }

    .hamburger div {
        width: 25px;
        height: 3px;
        background-color: white;
        transition: 0.3s;
    }

    .theme-selector {
        width: auto;
        margin: 0 10px;
        padding: 5px;
        background: transparent;
        box-shadow: none;
    }

    .theme-selector label {
        display: none; /* Hide the label on mobile */
    }

    .theme-selector select {
        padding: 6px 25px 6px 10px;
        font-size: 13px;
        border-radius: 15px;
        background-size: 10px;
        background-position: right 8px center;
        min-width: 90px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff; /* Bright white text for the selected option */
    }

    /* Style the dropdown options */
    .theme-selector select option {
        background-color: #292929; /* Dark background for options */
        color: #fff; /* White text for options */
        padding: 10px;
    }

    /* Default theme option */
    .theme-selector select option[value="default"] {
        color: #F39C12; /* Orange color for default theme */
    }

    /* Silver theme option */
    .theme-selector select option[value="silver"] {
        color: #757575; /* Silver color */
    }

    /* Black theme option */
    .theme-selector select option[value="black"] {
        color: #bb86fc; /* Purple color for black theme */
    }

    .theme-selector select:hover,
    .theme-selector select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 1px var(--primary-color);
        color: #fff; /* Ensure text remains white when focused */
    }

    .search-controls {
        margin: 15px 10px 20px;
        width: calc(100% - 30px); /* Account for container padding */
    }

    .search-bar,
    .filter-select {
        padding: 10px 15px;
        font-size: 14px;
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }

    .quotes-container {
        padding: 10px;
    }

    .quote {
        padding: 15px;
        margin: 10px 0;
    }

    .quote-text {
        font-size: 1em;
        line-height: 1.4;
    }

    .quote-author {
        font-size: 0.9em;
    }

    .quote-tags {
        margin-top: 8px;
    }

    .tag {
        padding: 2px 8px;
        font-size: 0.75em;
    }

    .watermark {
        position: relative;
        margin-top: 8px;
        font-size: 0.8em;
        text-align: right;
        display: block;
        padding-top: 8px;
    }

    .quote-category {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .dropdown-menu {
        width: 100%;
        left: 0;
        right: 0;
        top: 40px;
    }

    .user-info {
        padding: 8px 12px;
    }

    .dropdown-menu button {
        padding: 8px 12px;
        font-size: 14px;
    }

    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
        text-align: center;
    }

    .footer {
        padding: 40px 20px;
        text-align: center;
    }

    .footer .logo {
        font-size: 22px;
        justify-content: center;
        margin-bottom: 20px;
    }

    .footer .items {
        gap: 24px;
        align-items: center;
    }

    .footer .item {
        font-size: 16px;
    }

    .share-button {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Navigation Menu Animation for Mobile */
@media (max-width: 768px) {
    .navigation.active .hamburger div:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .navigation.active .hamburger div:nth-child(2) {
        opacity: 0;
    }

    .navigation.active .hamburger div:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .navigation .items {
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .navigation.active .items {
        transform: translateY(0);
    }
}
