/* Import layout, component, and utility styles */
@import url('layout.css');
@import url('components/panels.css');
@import url('components/header.css');
@import url('components/footer.css');
@import url('components/thumbnails.css'); /* Added */

/* TODO: import on debug mode only */
@import url('debug.css');


:root {
--background: hsla(0, 0%, 96%, 1);
--alternative: hsla(343, 100%, 53%, 1);
--primary: hsla(214, 100%, 52%, 1); /*  #007bff; */
--primary-dark: hsla(214, 100%, 38%, 1); /*  #007bff; */

--secondary: hsla(265, 11%, 22%, 1);
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    background-color: var(--background); /* Light background */
    color: #333;
    letter-spacing: -0.03em;
    font-weight: 200;
}

h1, h2, h3 {
    color: #333;
    font-weight: 400;
}

h1 { margin-bottom: 20px; }
h2 { margin-bottom: 15px; }
h3 { margin-top: 0; margin-bottom: 5px; }

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 400;
}

input[type="text"],
input[type="number"],
textarea,
input[type="file"],
input[type="email"] { /* Added email type */
    width: 100%;
    padding: 10px; /* Slightly larger padding */
    margin-bottom: 15px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    border-radius: 4px; /* Rounded corners */
}

textarea {
    min-height: 100px;
}

/* --- Button Base Styles (Mobile First) --- */
button,
input[type="submit"],
.auth-buttons a, /* Include auth buttons */
.pay-button { /* Include pay button */
    display: block; /* Make buttons block level */
    width: 100%; /* Full width on mobile */
    padding: 12px 20px;
    background-color: var(--primary);
    color: white !important; /* Ensure white text, important for overriding 'a' styles */
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    border-radius: 25px; /* Pill shape */
    transition: background-color 0.2s ease-in-out, width 0.2s ease-in-out; /* Smooth hover and width transition */
    text-align: center; /* Center text */
    text-decoration: none; /* Remove underline from links styled as buttons */
    box-sizing: border-box; /* Include padding in width */
    margin-bottom: 10px; /* Add some space below buttons */
}

button:hover,
input[type="submit"]:hover,
.auth-buttons a:hover,
.pay-button:hover {
    background-color: var(--primary-dark);
     /* #0056b3; */
    text-decoration: none; /* Keep underline off on hover */
}

/* Specific button colors (override base) */
.pay-button { background-color: #28a745; }
.pay-button:hover { background-color: #218838; }
/* Logout button in nav needs specific styling later */


hr {
    margin-top: 40px;
    border: 0;
    border-top: 1px solid #ccc;
}

a {
    color: #007bff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Link List Styles */
.link-list {
    margin-top: 30px;
    /* Grid styles moved to media query */
}

.link-item {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px; /* Keep margin for mobile */
    background-color: #fff; /* White background for items */
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtle shadow */
}

.link-item p {
    margin: 5px 0;
}

.link-item a {
    word-break: break-all;
}

.content-item a {
    display: block;
    word-break: break-all;
}

.no-links {
    color: #777;
    font-style: italic;
}

/* View Content Styles */
.price {
    font-size: 1.3em; /* Larger price */
    font-weight: 400;
    color: #28a745;
    margin-bottom: 15px;
}

.description {
    margin-bottom: 20px;
    color: #555;
}

.media-container {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
    /* Grid styles moved to media query */
}

.media-item {
    margin-bottom: 20px; /* Keep margin for mobile */
}

.media-item img,
.media-item video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    border: 1px solid #ddd;
    border-radius: 4px; /* Rounded corners for media */
}

.paywall {
    text-align: center;
    padding: 30px;
    margin-top: 20px;
    border: 1px dashed #ccc;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.creator-notice {
    background-color: #e9f7fd;
    border: 1px solid #bce8f1;
    color: #31708f;
    padding: 10px 15px; /* More padding */
    margin-bottom: 20px; /* More space below */
    border-radius: 4px;
}

/* Utility */
.text-center {
    text-align: center;
}

.faint-on-load {
    opacity: 0.5;
}

.faint-on-load input:focus {
    opacity: 1;
}

/* Flash Messages */
.alert {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid transparent;
}
.alert-error { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-warning { background-color: #fff3cd; color: #856404; border-color: #ffeeba; }
.alert-success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-info { background-color: #d1ecf1; color: #0c5460; border-color: #bee5eb; }


/* Auth & Dashboard Styles (Original - some might be overridden by nav styles below) */
.user-dashboard {
    /* margin-top: 30px; */ /* Removed margin-top */
    /* padding: 20px; */ /* Removed padding */
    /* border: 1px solid #eee; */ /* Removed border */
    /* border-radius: 5px; */ /* Removed border-radius */
    /* background-color: #f9f9f9; */ /* Removed background */
    display: flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically center items */
    gap: 15px;
    color: white;
}

.role-badges {
    margin-bottom: 0;
}
.role-badges-inline { /* New class for inline badges in nav */
    display: inline-flex; /* Use inline-flex */
    gap: 5px; /* Space between badges */
    margin: 0 0.4rem; /* Add some horizontal margin */
    font-size:0.7rem;
    vertical-align: super;
    margin-bottom:0.3rem;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    /* margin-right: 5px; */ /* Removed margin-right, using gap now */
    background-color: #e0e0e0;
    color: #333;
    border-radius: 10px;
    font-size: 0.9em;
}

/* Panel container - moved most panel styles to components/panels.css */
.action-panels {
    margin-top: 1rem;
}

.auth-actions {
    margin-top: 0; /* Remove margin-top */
    margin-left: auto; /* Push logout to the right */
}

.auth-buttons {
    /* margin: 20px 0; */ /* Removed margin */
    display: flex; /* Use flexbox */
    gap: 10px; /* Space between buttons */
    flex-direction: column; /* Stack buttons vertically on mobile */
}

/* Remove specific styling for auth buttons 'a' tags as they are now covered by the main button styles */
/* .auth-buttons a, ... */
/* .auth-buttons a:hover, ... */


.quick-roles {
    /* margin-top: 20px; */ /* Removed margin */
    /* padding-top: 15px; */ /* Removed padding */
    /* border-top: 1px solid #eee; */ /* Removed border */
    /* display: flex; Use flexbox */
    align-items: center; /* Vertically center items */
    gap: 10px;
    margin-left: auto;
    color: white;
}

.quick-roles h3 {
    margin-bottom: 0;
    font-size: 1rem;
    display:block;
    clear:both;
}

.quick-roles span { /* Style the "Quick Demo:" text */
    color: #ccc; /* Lighter color */
    font-size: 0.9em;
}

.quick-roles a {
    /* background-color: #6c757d; */ /* Remove background for text-only */
    padding: 5px 0 !important; /* Adjust padding, remove horizontal */
    margin: 0 5px !important; /* Adjust margin */
    border-radius: 0 !important; /* Remove border-radius */
    background: none !important; /* Ensure no background */
    border: none !important; /* Ensure no border */
    color: #aaa !important; /* Lighter color for demo links */
}

.quick-roles a:hover {
    /* background-color: #5a6268; */
    background: none !important;
    color: white !important; /* White on hover */
    text-decoration: underline !important; /* Add underline on hover */
}

.auth-actions a { /* Specific style for logout link in nav */
    /* background-color: #dc3545; */ /* Remove background for text-only */
     padding: 5px 0 !important; /* Adjust padding, remove horizontal */
     margin: 0 5px !important; /* Adjust margin */
     border-radius: 0 !important; /* Remove border-radius */
     background: none !important; /* Ensure no background */
     border: none !important; /* Ensure no border */
     color: #ff8a8a !important; /* Light red color */
}

.auth-actions a:hover {
    /* background-color: #c82333; */
    background: none !important;
    color: #ff5252 !important; /* Brighter red on hover */
    text-decoration: underline !important; /* Add underline on hover */
}

/* Auth Form Styles (from templates) */
.form-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff; /* Added background */
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}

input + label {
    display:inline-block
}

#remember-ctr {
    display: flex;
    align-items: baseline !important;
    white-space: nowrap;
    gap: 0.5rem;
}

#remember-ctr input {

    width: 1rem;
}

.form-group input { /* Combined with main input styles */
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
}
.form-actions {
    margin-top: 20px;
}

/* --- Upload Form Specific Styles --- */
.file-upload-area {
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    margin-bottom: 15px;
    border-radius: 8px; /* Rounded rect */
    background-color: #fafafa; /* Slightly different background */
    cursor: pointer; /* Indicate it's interactive */
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.file-upload-area:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
}
.file-upload-area label {
    font-weight: normal; /* Less prominent label */
    color: #555;
    margin-bottom: 10px;
}
.file-upload-area input[type="file"] {
    /* Basic reset - browser default is often sufficient here, but hide if needed */
     width: auto;
     padding: 0;
     margin-bottom: 0;
     border: none;
     display: inline-block; /* Or block depending on desired layout */
}




@media (min-width: 768px) {
    button,
    input[type="submit"],
    .auth-buttons a, 
    .pay-button {
        width: auto;
        max-width: 350px;
        display: block;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 15px;
    }

    form button[type="submit"] {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    body > .auth-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
    }
    body > .auth-buttons a {
         width: auto;
         max-width: 200px;
    }

    .link-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin-top: 30px;
    }
    .link-item {
        margin-bottom: 0;
    }

    .media-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin-top: 20px;
        padding-top: 20px;
    }
    .media-item {
         margin-bottom: 0;
    }

    .nav-right .auth-buttons {
        flex-direction: row;
    }
}

/* --- Responsive Nav Auth Links --- */
@media (max-width: 400px) {
    .nav-right .auth-buttons a:not(:first-child) {
        display: none;
    }
    .nav-right .auth-buttons {
        gap: 5px;
    }
    .nav-right a {
        padding: 5px;
    }
}

/* Additional responsiveness for very narrow screens */
@media (max-width: 300px) {
    .nav-right .auth-buttons {
        flex-direction: column;
        align-items: flex-end;
    }
    .nav-right .auth-buttons a {
        margin-bottom: 5px;
    }
}
