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

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

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

header {
    background: #2c3e50;
    color: white;
    padding: 0 20px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 0;
}

.navbar .brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
}

.nav-links a:hover {
    text-decoration: underline;
}

.btn-link {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
}

.btn-link:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
}

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

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
}

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

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

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

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    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: #2c3e50;
    color: white;
}

tr:hover {
    background: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.code-display {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-size: 1.1rem;
}

footer {
    text-align: center;
    padding: 20px;
    color: #666;
    margin-top: 40px;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.text-muted {
    color: #6c757d;
}

.mb-2 {
    margin-bottom: 10px;
}

.mt-2 {
    margin-top: 10px;
}

/* Brand Details Page */
.brand-header {
    display: flex;
    align-items: center;
    gap: 24px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.brand-logo {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    font-size: 3rem;
    font-weight: bold;
    border-radius: 8px;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-info {
    flex-grow: 1;
}

.brand-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.brand-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.brand-category {
    color: #666;
    font-size: 1.1rem;
}

.brand-notes {
    color: #888;
    font-style: italic;
    margin-top: 8px;
}

.brand-description {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.brand-description h3 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.brand-description p {
    color: #555;
    line-height: 1.7;
    margin: 0;
}

.referral-section {
    margin-bottom: 30px;
}

.referral-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.referral-status {
    margin-bottom: 20px;
}

.code-section {
    margin-bottom: 24px;
}

.code-section label,
.link-section label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.code-container {
    display: flex;
    gap: 10px;
}

.code-input {
    flex-grow: 1;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #2c3e50;
    letter-spacing: 2px;
}

.code-input:focus {
    outline: none;
    border-color: #3498db;
}

.btn-copy {
    padding: 15px 25px;
    background: #3498db;
    color: white;
    font-weight: 600;
    min-width: 100px;
}

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

.link-section {
    margin-bottom: 24px;
}

.btn-referral-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #9b59b6;
    padding: 15px 25px;
    font-weight: 600;
}

.btn-referral-link:hover {
    background: #8e44ad;
}

.shop-section {
    margin-bottom: 24px;
}

.btn-shop {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #27ae60;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-shop:hover {
    background: #219a52;
}

.assignment-actions {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
}

.btn-outline:hover {
    background: #e74c3c;
    color: white;
}

.btn-lg {
    padding: 15px 40px;
    font-size: 1.2rem;
}

.no-assignment-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.no-assignment-card p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.login-prompt {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.login-prompt p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.login-prompt .actions {
    justify-content: center;
}

.back-link {
    margin-top: 20px;
}

.back-link a {
    color: #3498db;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Brand Card Styles */
.brand-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.brand-card-header h3 {
    margin-bottom: 0;
}

.brand-card-logo-container {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 6px;
    overflow: hidden;
}

.brand-card-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-card-placeholder {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 8px;
    flex-shrink: 0;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.feedback-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-buttons .btn {
    width: 100%;
}

.subscribe-prompt {
    padding: 10px 0;
}

/* Admin Table Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.admin-table th {
    background: #2c3e50;
    color: white;
    font-weight: 600;
}

.admin-table tr:hover {
    background: #f5f5f5;
}

.badge-warning {
    background: #f39c12;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.badge-danger {
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}
