/**
 * Internal PHP Object Storage Service - Admin Styles
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
header {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    font-size: 1.5rem;
    color: #2c3e50;
}

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

nav a {
    color: #3498db;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s;
}

nav a:hover,
nav a.active {
    background: #3498db;
    color: #fff;
}

/* User Info */
.user-info {
    background: #e8f4fd;
    padding: 10px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    color: #2980b9;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

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

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert p {
    margin: 0;
}

.alert-error {
    background: #fdeaea;
    color: #c0392b;
    border: 1px solid #e74c3c;
}

.alert-success {
    background: #e8f8f5;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.alert-info {
    background: #e8f4fd;
    color: #2980b9;
    border: 1px solid #3498db;
}

.alert-warning {
    background: #fef9e7;
    color: #d68910;
    border: 1px solid #f39c12;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.help {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Upload Form */
.upload-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 600px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

tr:hover {
    background: #f8f9fa;
}

/* Files Table */
.files-table {
    overflow-x: auto;
}

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

.files-table .token-info {
    margin-bottom: 5px;
}

.files-table .token-link {
    color: #3498db;
    text-decoration: none;
}

.files-table .token-link:hover {
    text-decoration: underline;
}

.files-table .token-expiry {
    font-size: 11px;
    color: #e74c3c;
}

/* Activity Section */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.activity-section,
.tokens-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.activity-section h2,
.tokens-section h2 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.activity-table .help-text {
    margin-top: 15px;
    font-size: 12px;
}

/* Quick Actions */
.quick-actions {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quick-actions h2 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 5px;
}

.login-box .subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.login-box .footer {
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    color: #95a5a6;
}

/* Token Result */
.token-result {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 700px;
}

.token-info-box,
.token-box {
    margin-bottom: 20px;
}

.token-info-box h3,
.token-box h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.url-box {
    display: flex;
    gap: 10px;
}

.url-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* File Info */
.file-info {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 500px;
    margin-bottom: 20px;
}

.file-info h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.info-table {
    margin: 0;
}

.info-table tr {
    border: none;
}

.info-table th {
    width: 120px;
    background: none;
    padding: 8px 0;
}

.info-table td {
    padding: 8px 0;
    border: none;
}

/* Token Form */
.token-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 400px;
}

/* Recent Uploads */
.recent-uploads {
    margin-top: 40px;
}

.recent-uploads h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

/* Delete Form */
.delete-form {
    display: inline;
}

/* File Preview / Thumbnail */
.file-preview {
    width: 80px;
    text-align: center;
}

.file-preview .thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.file-preview .thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.file-preview .file-icon {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
}

.file-preview .no-preview {
    font-size: 11px;
    color: #999;
}

.url-input {
    width: 300px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    nav {
        justify-content: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .url-box {
        flex-direction: column;
    }
}
