/* Modern Django Admin Theme */

/* Reset and Base Styles */
:root {
    --primary-color: #3973bb;
    --secondary-color: #568ed3;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --text-color: #1f2937;
    --background-light: #f3f4f6;
    --border-color: #e5e7eb;
    --header-bg: #568ed3;
}
fieldset .fieldset-heading, fieldset .inline-heading, :not(.inline-related) .collapse summary {
    border: 1px solid #568ed3;
    margin: 0;
    padding: 8px;
    font-weight: 400;
    font-size: 0.8125rem;
    background: #568ed3 !important;
    color: var(--header-link-color);
}
select {
    height: 2.5rem !important;
}

/* Header Styling */
#header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#branding h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#branding h1 a:link, #branding h1 a:visited {
    color: white;
}

/* User Tools */
#user-tools {
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

#user-tools a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

#user-tools a:hover {
    color: white;
    border-bottom-color: white;
}

/* Breadcrumbs */
div.breadcrumbs {
    background: var(--secondary-color);
    padding: 0.75rem 2rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

div.breadcrumbs a {
    color: white;
}

/* Main Content Area */
#content {
    padding: 2rem;
}

.module {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.module h2, .module caption {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* Form Styling */
.form-row {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.form-row:last-child {
    border-bottom: none;
}

form label {
    color: var(--text-color);
    font-weight: 500;
}

/* Input Fields */
input[type="text"], 
input[type="password"], 
input[type="email"], 
input[type="number"], 
input[type="url"], 
select, 
textarea {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    width: 100%;
    max-width: 500px;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus, 
input[type="password"]:focus, 
input[type="email"]:focus, 
input[type="number"]:focus, 
input[type="url"]:focus, 
select:focus, 
textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.button, 
input[type=submit], 
input[type=button], 
.submit-row input {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.button:hover, 
input[type=submit]:hover, 
input[type=button]:hover {
    background: var(--secondary-color);
}

.button.delete-button {
    background: var(--danger-color);
}

/* List View */
#changelist {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#changelist .actions {
    padding: 1rem;
    background: var(--background-light);
    border-bottom: 1px solid var(--border-color);
}

#changelist table {
    width: 100%;
    border-collapse: collapse;
}

#changelist table thead th {
    background: var(--background-light);
    padding: 0.75rem;
    font-weight: 600;
    text-align: left;
    color: var(--text-color);
}

#changelist table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

#changelist table tbody tr:hover {
    background: var(--background-light);
}

#changelist table tbody td {
    padding: 0.75rem;
}

/* Dashboard */
.dashboard .module table th {
    width: 100%;
    color: var(--text-color);
    font-weight: 600;
}

.dashboard .module table td {
    white-space: nowrap;
}

/* Messages */
.messagelist {
    padding: 0;
    margin-bottom: 1rem;
}

.messagelist li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.messagelist li.success {
    background: #ecfdf5;
    color: var(--success-color);
}

.messagelist li.error {
    background: #fef2f2;
    color: var(--danger-color);
}

.messagelist li.warning {
    background: #fffbeb;
    color: var(--warning-color);
}

/* Pagination */
.paginator {
    padding: 1rem;
    background: var(--background-light);
    font-size: 0.875rem;
}

.paginator a {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--primary-color);
    text-decoration: none;
}

.paginator a:hover {
    background: var(--primary-color);
    color: white;
}

/* Filter Sidebar */
#changelist-filter {
    background: var(--background-light);
    padding: 1rem;
    border-left: 1px solid var(--border-color);
}

#changelist-filter h2 {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

#changelist-filter h3 {
    font-size: 0.875rem;
    margin: 1rem 0 0.5rem;
}

#changelist-filter ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#changelist-filter li {
    padding: 0.25rem 0;
}

#changelist-filter li.selected {
    font-weight: 600;
}

#changelist-filter li a {
    color: var(--text-color);
    text-decoration: none;
}

#changelist-filter li a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    #content {
        padding: 1rem;
    }
    
    .form-row {
        padding: 0.75rem;
    }
}

@media (max-width: 767px) {
    #header {
        padding: 1rem;
    }
    
    #branding h1 {
        font-size: 1.25rem;
    }
    
    .form-row input[type="text"], 
    .form-row input[type="password"], 
    .form-row input[type="email"], 
    .form-row input[type="number"], 
    .form-row input[type="url"], 
    .form-row select, 
    .form-row textarea {
        max-width: 100%;
    }
}

.actions label,
.actions select,
.actions button {
    vertical-align: middle !important;
    margin-bottom: 0 !important;
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.actions label {
    margin-bottom: 0;
    margin-right: 4px;
}

.actions .action-counter {
    margin-left: 12px;
    font-size: 90%;
}
