/* 
Base styles for Deal Radar web app.
- Layout, typography, header, navigation bar, footer, and responsive design.
- Navbar and footer use purple gradients for brand consistency.
- Includes skip link for accessibility.
*/

/* Beautiful base styles matching your original design */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    background: #f5f6fa;
    color: #333;
    padding-top: 80px; /* Adjust based on your navbar height */
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
    position: relative; /* Ensure container doesn't interfere with fixed positioning */
}

/* Gorgeous header with purple gradient */
.header { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    color: white; 
    padding: 60px 40px; 
    border-radius: 25px; 
    text-align: center; 
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.header h1 {
    font-size: 3.5em;
    margin: 0 0 15px 0;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.header p {
    font-size: 1.3em;
    margin: 0;
    opacity: 0.95;
    font-weight: 300;
}

/* Enhanced navigation bar - Midnight Black Theme */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, rgba(83, 54, 116, 0.95) 0%, rgba(48, 63, 159, 0.95) 100%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    color: white;
    min-height: 60px;
    height: auto; /* Allow height to grow */
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(168, 181, 255, 0.2);
}

/* Brand Section - Left */
.nav-brand {
    flex: 0 0 auto;
    margin-right: 20px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.brand-link:hover {
    color: #a8b5ff;
    transform: translateY(-1px);
}

.brand-text {
    color: white;
    white-space: nowrap;
}

.navbar-radar {
    width: 30px;
    height: 30px;
    animation: spin 3s linear infinite;
    filter: drop-shadow(0 0 10px rgba(168, 181, 255, 0.6));
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Center Section - Categories + Navigation */
.nav-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

/* Categories Dropdown */
.categories-dropdown {
    position: relative;
    z-index: 1000;
}

.dropdown-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 240px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    z-index: 1001;
    overflow: hidden;
    margin-top: 4px;
    border: 1px solid rgba(168, 181, 255, 0.2);
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
    color: #667eea;
    transform: translateX(5px);
}

/* Animation for JavaScript version */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Navigation & Auth Buttons Refactored --- */

/* Shared styles for nav links and auth buttons */
.nav-link,
.nav-login,
.nav-signup,
.nav-logout {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    background: none;
    outline: none;
    cursor: pointer;
}

/* Nav link specific */
.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid transparent;
    padding: 10px 16px;
}

.nav-link:hover,
.nav-login:hover,
.nav-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8f9fa !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #653e8b 100%);
    color: white !important;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    font-weight: 700;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
}

/* Signup button gradient */
.nav-signup {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #28a745;
    border: 1px solid transparent;
}

.nav-signup:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Logout button color */
.nav-logout {
    color: #dc3545;
    background: none;
}

.nav-logout:hover {
    background: #dc3545;
    color: rgb(80, 66, 83);
}

/* Login button color */
.nav-login {
    color: #667eea;
    background: none;
}

.nav-login:hover {
    background: #667eea;
    color: rgb(80, 66, 83);
}

/* Auth section */
.nav-auth {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-left: 20px;
    flex: 0 0 auto;
}

/* Welcome text */
.user-welcome {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 15px;
}

/* Logout form inline */
.logout-form {
    display: inline;
}

/* Hamburger styles */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-left: auto;
}

.hamburger {
    display: block;
    width: 28px;
    height: 3px;
    background: #fff;
    position: relative;
    border-radius: 2px;
}
.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    width: 28px;
    height: 3px;
    background: #fff;
    position: absolute;
    border-radius: 2px;
    transition: 0.3s;
}
.hamburger::before {
    top: -9px;
}
.hamburger::after {
    top: 9px;
}

/* Responsive Navbar
   - Collapses navigation and auth links into hamburger menu on small screens.
   - Adjusts padding and layout for mobile usability.
*/
@media (max-width: 900px) {
    body {
        padding-top: 44px; /* Match reduced navbar height */
    }
    .nav-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 6px 8px;
        min-height: 44px;
        height: auto;
    }
    .nav-toggle {
        display: block;
        padding: 6px;
    }
    .nav-center {
        display: none;
        flex-direction: column;
        width: 100%;
        background: linear-gradient(135deg, rgba(83,54,116,0.98) 0%, rgba(48,63,159,0.98) 100%);
        position: absolute;
        top: 44px;
        left: 0;
        z-index: 999;
        padding: 10px 0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }
    .nav-bar.active .nav-center {
        display: flex;
    }
    .nav-links,
    .nav-auth {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 10px;
    }
}

/* For very small screens */
@media (max-width: 600px) {
    body {
        padding-top: 40px; /* Lower padding to match thinner navbar */
    }
    .nav-bar {
        padding: 2px 4px;
        min-height: 36px;
    }
    .nav-center {
        top: 36px;
    }
}

/* Professional Footer
   - Uses gradients and subtle patterns for a modern look.
   - Contains brand, links, social, and legal info.
*/
.footer {
    background: linear-gradient(135deg, #2d1b69 0%, #3a1c71 100%);
    color: white;
    margin-top: 60px;
    padding: 60px 0 20px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Add subtle pattern overlay */
.footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.02)"/></pattern></defs><rect width="100" height="100" fill="url("#grain#grain")"/></svg>');
    pointer-events: none;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    align-items: start;
    position: relative;
    z-index: 1;
}

.footer-brand-section {
    padding-right: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.footer-logo {
    width: 45px;
    height: 45px;
    filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.8));
}

.footer-brand h3 {
    color: white;
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    background: linear-gradient(135deg, #a8b5ff 0%, #e8b3ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(168, 181, 255, 0.3);
}

.footer-description {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 15px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.social-link {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s ease;
    border: 2px solid rgba(168, 181, 255, 0.2);
}

.social-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    border: 2px solid rgba(168, 181, 255, 0.5);
}

.footer-section h4 {
    color: white;
    margin-bottom: 25px;
    font-size: 1.2em;
    font-weight: 600;
    position: relative;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(135deg, #a8b5ff 0%, #e8b3ff 100%);
    box-shadow: 0 0 10px rgba(168, 181, 255, 0.5);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    display: block;
    padding: 3px 0;
}

.footer-links a:hover {
    color: #a8b5ff;
    transform: translateX(5px);
    text-shadow: 0 0 10px rgba(168, 181, 255, 0.5);
}

.footer-follow-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.footer-social-large {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(168, 181, 255, 0.2);
}

.social-btn:hover {
    background: rgba(168, 181, 255, 0.2);
    color: white;
    transform: translateX(3px);
    border: 1px solid rgba(168, 181, 255, 0.4);
}

.footer-legal {
    margin-top: 20px;
}

.footer-legal h5 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-links-small {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-small li {
    margin-bottom: 8px;
}

.footer-links-small a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s ease;
}

.footer-links-small a:hover {
    color: #a8b5ff;
}

.footer-bottom {
    border-top: 1px solid rgba(168, 181, 255, 0.2);
    margin-top: 40px;
    padding-top: 25px;
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    font-size: 14px;
}

/* Supported Sites Section
   - Displays logos of supported e-commerce sites.
*/
.supported-sites {
  padding: 2rem 0;
  background: #dee1f0; /* Light background for contrast */
  text-align: center;
}
.supported-sites h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}
.logo-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}
.logo-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  min-height: 80px;
}
.logo-card img {
  max-height: 40px;
  max-width: 120px;
  object-fit: contain;
}

/* Mobile Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 20px;
    }
    
    .footer-brand-section {
        padding-right: 0;
        text-align: center;
    }
    
    .footer-brand {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-section h4 {
        text-align: center;
    }
    
    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-links {
        text-align: center;
    }
    
    .footer-social-large {
        align-items: center;
    }
    
    .footer-legal {
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 40px;
    }
    .container {
        padding: 8px;
    }
    .header {
        padding: 30px 8px;
    }
    .header h1 {
        font-size: 2em;
    }
}

/* Skip Link Styles
   - Accessibility: allows keyboard users to skip to main content.
*/
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: #fff;
  color: #333;
  z-index: 1000;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: bold;
  transition: left 0.2s;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  outline: 2px solid #764ba2;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* My Account Button Styles
   - Styles for the "My Account" button shown to logged-in users.
*/
.my-account-btn-container {
    display: flex;
    justify-content: flex-end;
    margin: 18px 0 10px 0;
}

.my-account-btn {
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #b993d6 0%, #8ca6db 100%);
    border: none;
    border-radius: 6px;
    padding: 10px 28px;
    text-decoration: none;
    transition: background 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(140,166,219,0.08);
    font-size: 1.1rem;
    display: inline-block;
}

.my-account-btn:hover, .my-account-btn:focus {
    background: linear-gradient(135deg, #8ca6db 0%, #b993d6 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(140,166,219,0.18);
    text-decoration: none;
}

/* Stylish Dropdowns for Add Product Form
   - Custom select styling for category/product forms.
*/
.form-select, select {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
    border: 1.5px solid #b993d6;
    border-radius: 8px;
    color: #333;
    padding: 10px 14px;
    font-size: 1.05rem;
    font-weight: 500;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(140,166,219,0.06);
    margin-bottom: 10px;
}

.form-select:focus, select:focus {
    border: 1.5px solid #764ba2;
    box-shadow: 0 0 0 2px #b993d6;
    background: linear-gradient(135deg, #e8f0ff 0%, #d1c4e9 100%);
}

.form-select:disabled, select:disabled {
    background: #f3f3fa;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.7;
}

.supported-sites-heading {
    text-align: center;
    display: block;
    width: 100%;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}