/* style.css */
/* Sample COmmentort a modern Google Font */
/* Import a modern Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6D5BBA;
    --primary-dark: #5a4a9c;
    --success: #10B981;
    --success-dark: #059669;
    --danger: #EF4444;
    --danger-dark: #DC2626;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --bg-light: #F9FAFB;
    --border-light: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 1rem;
    --max-width-sm: 480px;
    --max-width-md: 768px;
    --max-width-lg: 1024px;
    --max-width-xl: 1280px;
    --header-height: 80px;
    --container-padding: 2rem;
    --section-spacing: 4rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container, .dashboard-container {
    max-width: var(--max-width-xl);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

/* Navigation */
header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    background: white;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

nav {
    max-width: var(--max-width-xl);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
    letter-spacing: -0.025em;
}

.logo:hover {
    color: var(--primary-dark);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

/* Main content */
main {
    margin-top: var(--header-height);
    padding: var(--section-spacing) 0;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
}

.hero {
    max-width: var(--max-width-lg);
    margin: 0 auto;
    text-align: center;
    padding: 4rem 0 6rem;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--primary) 0%, #9181D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
}

/* URL Shortener */
.shortener-box {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 5rem;
    max-width: var(--max-width-lg);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.url-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.url-form .form-group {
    margin-bottom: 0;
    max-width: 100%;
}

.url-form .form-group input {
    width: 100%;
    max-width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
}

.url-form .btn {
    width: auto;
    padding-left: 2rem;
    padding-right: 2rem;
    margin-top: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s ease;
    color: var(--text-primary);
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109, 91, 186, 0.1);
}

.url-input::placeholder, input[type="url"]::placeholder, input[type="text"]::placeholder {
    color: var(--text-tertiary);
}

.btn-shorten {
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.btn-shorten:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Result box */
.result-box {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-top: 1.5rem;
}

.result-box .short-url-input {
    flex: 1;
    min-width: 0;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 1rem;
    background: white;
    color: var(--text-primary);
    font-weight: 500;
}

.result-box .btn-copy {
    width: auto;
    white-space: nowrap;
    padding: 0 2rem;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 5rem;
    padding: 0 1rem;
}

.feature {
    text-align: center;
    padding: 2.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.375rem;
    font-weight: 600;
}

.feature p {
    color: var(--text-secondary);
    font-size: 1.0625rem;
    line-height: 1.6;
}

/* Dashboard styles */
.dashboard-header {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.dashboard-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0;
}

.dashboard-section {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.dashboard-section h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.btn-logout {
    background: var(--danger);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-logout:hover {
    background: var(--danger-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Table styles */
.table-container {
    margin-top: 2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px; /* Ensure minimum width for content */
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-light);
}

td {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9375rem;
}

/* Column widths */
table th:nth-child(1),
table td:nth-child(1) {
    width: 25%;
}

table th:nth-child(2),
table td:nth-child(2) {
    width: 40%;
}

table th:nth-child(3),
table td:nth-child(3) {
    width: 15%;
}

table th:nth-child(4),
table td:nth-child(4) {
    width: 20%;
}

/* Truncate long URLs */
.truncate {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action buttons */
.actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
}

.btn-action {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 70px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-edit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-delete {
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.btn-delete:hover {
    background: var(--danger-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Alerts */
.alert {
    padding: 1.25rem 1.75rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    text-align: center;
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

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

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.alert-success {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #86EFAC;
}

/* Footer */
footer {
    background: white;
    border-top: 1px solid var(--border-light);
    padding: 2rem 0;
    margin-top: auto;
}

footer p {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9375rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --container-padding: 1.5rem;
        --section-spacing: 3rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero .subtitle {
        font-size: 1.25rem;
    }

    .card {
        padding: 2rem;
    }

    .dashboard-header {
        padding: 1.5rem;
    }

    .dashboard-section {
        padding: 1.5rem;
    }

    th, td {
        padding: 0.875rem 1rem;
    }

    .url-form .btn {
        width: auto;
        align-self: flex-start;
    }

    .result-box {
        flex-direction: column;
    }

    .result-box .btn-copy {
        width: 100%;
    }

    .dashboard-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .dashboard-actions .btn {
        width: 100%;
    }

    .auth-card {
        padding: 2rem;
    }

    .table-container {
        margin: 1rem -1.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    table {
        min-width: 650px;
    }

    .truncate {
        max-width: 200px;
    }

    .actions {
        gap: 0.375rem;
    }

    .btn-action {
        padding: 0.375rem 0.75rem;
        min-width: 60px;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    :root {
        --container-padding: 1rem;
        --section-spacing: 2rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero .subtitle {
        font-size: 1.125rem;
    }

    .card {
        padding: 1.5rem;
    }

    .dashboard-header h2 {
        font-size: 1.75rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .stat-card .number {
        font-size: 1.5rem;
    }
}

/* Authentication Pages */
.auth-container {
    max-width: var(--max-width-sm);
    margin: auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.auth-card h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.auth-form {
    margin-bottom: 2rem;
}

.auth-form .form-group:last-child {
    margin-bottom: 0;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Dashboard Improvements */
.dashboard-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    text-align: center;
}

.stat-card h4 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card .number {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

/* Table Link Styles */
.table-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.table-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Update nav-links styling */
.nav-links .btn-secondary {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    font-size: 0.9375rem;
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.nav-links .btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

