/* General Styles */
body {
    font-family: sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

header {
    background-color: #4CAF50; /* Green theme */
    color: white;
    padding: 15px 0;
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 2.5em;
}
header p {
    margin: 5px 0 0;
    font-size: 1.1em;
}


footer {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    color: #777;
    font-size: 0.9em;
}

a {
    color: #4CAF50;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding in width */
}

.btn {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    text-align: center;
    transition: background-color 0.2s ease;
}
.btn:hover {
    background-color: #45a049;
    text-decoration: none; /* Remove underline on hover for buttons */
}
.btn-secondary {
     background-color: #aaa;
}
.btn-secondary:hover {
     background-color: #888;
}
.btn-small {
    padding: 5px 10px;
    font-size: 0.9em;
}
.btn-copy {
     background-color: #007bff; /* Blue for copy */
}
.btn-copy:hover {
    background-color: #0056b3;
}


/* Authentication Forms Layout */
.auth-container {
    max-width: 700px; /* Smaller container for auth */
}
.auth-forms {
    display: flex;
    gap: 30px; /* Space between forms */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: space-around;
}
.form-wrapper {
    flex: 1; /* Each form takes equal space */
    min-width: 280px; /* Minimum width before wrapping */
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #fdfdfd;
}
.form-wrapper h2 {
    margin-top: 0;
    text-align: center;
    color: #4CAF50;
    margin-bottom: 20px;
}

/* Dashboard */
.dashboard-header {
    background-color: #333; /* Darker header for dashboard */
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0; /* Remove bottom margin */
}
.dashboard-header h1 {
    font-size: 1.8em;
    margin: 0;
}
.dashboard-header nav span {
    margin-right: 15px;
}

.shorten-form .inline-group {
    display: flex;
    gap: 10px;
    align-items: center; /* Align items vertically */
}
.shorten-form .inline-group input[type="url"] {
    flex-grow: 1; /* Input takes available space */
}
.shorten-form .inline-group label.sr-only { /* Hide label visually but keep for accessibility */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Links Table */
.links-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.links-table th,
.links-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    word-break: break-all; /* Prevent long URLs from breaking layout */
}
.links-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}
.links-table tr:nth-child(even) {
    background-color: #f9f9f9;
}
.links-table tr:hover {
    background-color: #f1f1f1;
}
.links-table td[data-label="Actions"] {
    text-align: center;
}

/* Flash Messages */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: bold;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Table (Simple Stackable) */
@media screen and (max-width: 600px) {
    .links-table thead {
        display: none; /* Hide table header */
    }
    .links-table, .links-table tbody, .links-table tr, .links-table td {
        display: block;
        width: 100%;
    }
    .links-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd; /* Add border around each "row" */
    }
    .links-table td {
        text-align: right; /* Align content to the right */
        padding-left: 50%; /* Make space for the label */
        position: relative;
        border: none; /* Remove inner borders */
        border-bottom: 1px solid #eee; /* Add bottom border for separation */
    }
    .links-table td::before {
        content: attr(data-label); /* Use data-label as pseudo-element content */
        position: absolute;
        left: 10px;
        width: calc(50% - 20px); /* Adjust width */
        padding-right: 10px;
        font-weight: bold;
        text-align: left;
        white-space: nowrap;
    }
     .links-table td:last-child {
        border-bottom: none; /* Remove border from last cell in stack */
    }
    .links-table td[data-label="Actions"] {
        text-align: center; /* Center buttons */
        padding-left: 10px; /* Reset padding for action cell */
    }
     .links-table td[data-label="Actions"]::before {
         content: ""; /* Hide label for actions if needed */
     }

     .auth-forms {
        flex-direction: column; /* Stack forms vertically */
     }
     .form-wrapper {
        margin-bottom: 20px; /* Add space between stacked forms */
     }
}