/* Global Resets */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: #f4f7f6; color: #333; line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }

/* Buttons */
button, .btn-primary, .btn-secondary, .btn-create-link, .btn-login, .btn-dashboard {
    display: inline-block; padding: 10px 20px; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; transition: 0.3s; font-size: 15px; text-align: center;
}
.btn-primary { background-color: #007bff; color: white; }
.btn-primary:hover { background-color: #0056b3; }
.btn-secondary { background-color: #fff; color: #007bff; border: 2px solid #007bff; }
.btn-secondary:hover { background-color: #007bff; color: white; }

.btn-create-link { background: linear-gradient(45deg, #ff416c, #ff4b2b); color: white; box-shadow: 0 4px 10px rgba(255, 65, 108, 0.4); text-transform: uppercase; letter-spacing: 0.5px; border-radius: 20px; }
.btn-create-link:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(255, 65, 108, 0.6); color: white; }
.btn-login { background: #6f42c1; color: white; border-radius: 5px; }
.btn-login:hover { background: #5a32a3; color: white; }
.btn-dashboard { background: #28a745; color: white; border-radius: 5px; }

/* Header & Nav */
.header { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 75px; }
.logo img { height: 45px; max-width: 150px; object-fit: contain; margin-top: 5px; }
.navbar { display: flex; align-items: center; gap: 15px; }

/* Dropdown Menu (For About, Privacy, Profile) */
.dropdown { position: relative; display: inline-block; }
.dropbtn { background: transparent; color: #333; font-size: 24px; border: none; cursor: pointer; padding: 0 5px; font-weight: bold; outline: none; }
.dropdown-content { display: none; position: absolute; right: 0; background-color: #fff; min-width: 180px; box-shadow: 0 8px 20px rgba(0,0,0,0.15); border-radius: 8px; overflow: hidden; z-index: 1001; animation: fadeIn 0.3s; border: 1px solid #eee; }
.dropdown-content.show { display: block; }
.dropdown-content a { color: #333; padding: 12px 16px; text-decoration: none; display: block; font-size: 15px; font-weight: 500; border-bottom: 1px solid #f9f9f9; }
.dropdown-content a:hover { background-color: #f1f1f1; color: #007bff; }
.dropdown-header { padding: 12px 16px; font-weight: bold; background: #f8f9fa; color: #007bff; border-bottom: 1px solid #ddd; font-size: 14px; }

/* Hero Section */
.hero-section { padding: 80px 20px; background: linear-gradient(135deg, #007bff 0%, #0056b3 100%); color: white; }
.hero-title { font-size: 42px; margin-bottom: 15px; font-weight: 800; }
.hero-subtitle { font-size: 18px; margin-bottom: 30px; opacity: 0.9; max-width: 700px; margin-left: auto; margin-right: auto; }
.hero-buttons { display: flex; gap: 15px; justify-content: center; }

/* Shortener Box */
.shortener-section { 
    margin-top: -40px; 
    position: relative; 
    z-index: 10; 
    padding: 0 20px; 
    scroll-margin-top: 100px; 
}
.shortener-box { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); max-width: 800px; margin: 0 auto; }
.shortener-box h2 { margin-bottom: 20px; color: #333; }
#shortenerForm { display: flex; gap: 10px; }
#shortenerForm input { flex: 1; padding: 15px; font-size: 16px; border: 2px solid #ddd; border-radius: 8px; outline: none; }
#shortenerForm input:focus { border-color: #007bff; }
#shortenerForm button { background: #007bff; color: white; padding: 0 30px; font-size: 18px; border-radius: 8px; }
.result-box { margin-top: 25px; padding: 20px; background: #eef5ff; border: 1px dashed #007bff; border-radius: 8px; }
.result-box.hidden { display: none; }
.result-box p { color: #007bff; font-weight: bold; margin-bottom: 10px; }
.short-link-display { display: flex; gap: 10px; }
.short-link-display input { flex: 1; padding: 12px; font-size: 18px; color: #28a745; font-weight: bold; border: 1px solid #ccc; border-radius: 6px; background: #fff; }
.short-link-display button { background: #28a745; color: white; border-radius: 6px; }

/* Features & Cards */
.features-section { padding: 60px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.feature-card { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-align: center; }

/* Auth Layout */
.auth-body { background: #eaeff5; }
.auth-container { max-width: 450px; margin: 60px auto; padding: 40px 30px; background: #fff; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.auth-form-wrap { display: none; }
.auth-form-wrap.active { display: block; animation: fadeIn 0.4s; }
.auth-title { text-align: center; margin-bottom: 25px; color: #333; font-size: 24px; font-weight: 700; }
.form-group { margin-bottom: 15px; }
.form-group input { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 15px; }
.auth-btn { width: 100%; padding: 14px; font-size: 18px; margin-top: 10px; border-radius: 6px; }
.toggle-text { text-align: center; margin-top: 25px; font-size: 15px; font-weight: 500; color: #555; background: #f8f9fa; padding: 15px; border-radius: 6px; }
.toggle-text a { color: #ff416c; font-weight: 800; font-size: 16px; text-decoration: none; display: block; margin-top: 5px; }
.msg { padding: 10px; margin-bottom: 15px; border-radius: 5px; text-align: center; font-weight: bold; }
.msg.error { background: #ffe6e6; color: red; border: 1px solid red; }
.msg.success { background: #e6ffe6; color: green; border: 1px solid green; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Dashboard Tables */
.dashboard-header { background: #fff; padding: 30px 0; border-bottom: 1px solid #ddd; margin-bottom: 30px; }
.table-container { background: #fff; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); overflow: hidden; padding: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f8f9fa; color: #333; font-weight: bold; }
.btn-edit { background: #ffc107; color: #000; border-radius: 4px; padding: 6px 12px; font-size: 14px; }
.btn-copy { background: #17a2b8; color: #fff; border-radius: 4px; padding: 6px 12px; margin-right: 5px; font-size: 14px; }

/* Ads & Footer */
.ad-container { margin: 20px auto; text-align: center; padding: 10px; background: #f1f1f1; border: 1px dashed #ccc; max-width: 728px; min-height: 90px; display: flex; align-items: center; justify-content: center; color: #999; }
.footer { background: #333; color: #fff; padding: 30px 0; margin-top: 40px; }
.footer-links { margin-top: 10px; }
.footer-links a { color: #aaa; margin: 0 10px; }
.footer-links a:hover { color: #fff; }

/* Page Content (About & Privacy) */
.page-header { background: #fff; padding: 40px 20px; text-align: center; border-bottom: 1px solid #ddd; }
.page-content { padding: 40px 20px; line-height: 1.8; color: #444; }
.page-content h2 { color: #007bff; margin-top: 20px; margin-bottom: 10px; }
/* Page Content Indentation (About & Privacy) */
.page-content p { 
    margin-left: 15px; 
    margin-bottom: 15px; 
}
.page-content ul { 
    margin-left: 35px; 
    margin-bottom: 15px; 
}
.page-content li { 
    margin-bottom: 8px; 
}

/* Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.modal-content { background: #fff; margin: 15% auto; padding: 25px; width: 90%; max-width: 450px; border-radius: 8px; position: relative; }
.close { position: absolute; top: 10px; right: 15px; font-size: 28px; cursor: pointer; color: #ff416c; font-weight: bold; }

/* =========================================================
   Mobile Responsiveness (Header scaling, Table rearrange)
   ========================================================= */
@media (max-width: 768px) {
    /* Header Scaling */
    .nav-container { height: 65px; padding: 0 10px; }
    .logo img { height: 35px; max-width: 110px; }
    .navbar { gap: 8px; }
    
    /* Shrinking buttons so everything fits horizontally */
    .btn-create-link, .btn-login, .btn-dashboard { padding: 6px 10px; font-size: 12px; border-radius: 4px; }
    .dropbtn { font-size: 22px; padding: 0; }
    
    /* Hero & Forms */
    .hero-title { font-size: 28px; }
    #shortenerForm { flex-direction: column; }
    #shortenerForm button { padding: 12px; width: 100%; }
    .short-link-display { flex-direction: column; }
    
    /* Dashboard Table Mobile Structure */
    .table-container { padding: 10px; background: transparent; box-shadow: none; }
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { display: none; }
    tr { display: flex; flex-direction: column; border: 1px solid #ddd; margin-bottom: 15px; border-radius: 8px; padding: 15px; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
    td { padding: 5px 0; border: none; }
    .td-long-url { order: 1; font-size: 13px; color: #666; word-break: break-all; margin-bottom: 10px; border-bottom: 1px dashed #ddd; padding-bottom: 10px; }
    .td-short-url { order: 2; font-size: 18px; font-weight: bold; margin-bottom: 5px; }
    .td-stats { order: 3; font-size: 14px; margin-bottom: 5px; }
    .td-date { display: none; }
    .td-actions { order: 4; display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; border-top: 1px solid #eee; padding-top: 10px; }
    .td-actions button { flex: 1; padding: 10px; font-size: 14px; }
}