/* Starlab CNC File Sharing System - Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    --background: #f8fafc;
    --surface: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-img {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.logo p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Login Box */
.login-box {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--surface);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.login-box h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

/* Download Box */
.download-box {
    max-width: 600px;
    margin: 4rem auto;
    background: var(--surface);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.file-info h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background);
    border-radius: 0.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.info-item.full-width {
    flex-direction: column;
}

.info-item .label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-item .value {
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

.info-item.full-width .value {
    text-align: left;
}

.download-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 1.5rem;
    line-height: 1.5;
}

.error-box {
    text-align: center;
    padding: 2rem;
}

.error-box h2 {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-logo {
    max-width: 200px;
    height: auto;
}

.admin-header h1 {
    font-size: 1.875rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.admin-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

textarea {
    resize: vertical;
    font-family: inherit;
}

small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-align: center;
}

.btn:active {
    transform: translateY(1px);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

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

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-large {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

/* Upload Section */
.upload-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.upload-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Files Section */
.files-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.files-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.no-files {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Table */
.files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.files-table th {
    background: var(--background);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.files-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.files-table tbody tr:hover {
    background: var(--background);
}

.files-table td.actions {
    white-space: nowrap;
}

.files-table td.actions .btn {
    margin-right: 0.5rem;
}

/* Messages */
.error,
.success {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .files-table {
        font-size: 0.75rem;
    }

    .files-table th,
    .files-table td {
        padding: 0.5rem;
    }

    .login-box,
    .download-box {
        margin: 2rem auto;
        padding: 1.5rem;
    }

    .upload-section,
    .files-section {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .files-table td.actions .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.25rem;
        margin-right: 0;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.modal-content textarea {
    width: 100%;
    min-height: 400px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    background-color: var(--background);
}

.modal-content textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}
