/**
 * SMS Scratchcard Campaign System
 * Mobile-first Responsive Styles
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Landing Page Styles */
.landing-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-page .container {
    width: 100%;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.client-logo {
    max-width: 200px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.content-box {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.content-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.teaser-text {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
}

/* Form Styles */
.entry-form {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons - Soft UI Style */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    touch-action: manipulation;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover,
.btn-primary:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e9ecef;
    color: #344767;
    margin-top: 0;
}

.btn-secondary:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 12px;
    width: auto;
    display: inline-block;
}

.btn-danger {
    background: linear-gradient(135deg, #f5365c 0%, #fb6340 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(245, 54, 92, 0.4);
}

/* Messages */
.error-message,
.success-message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.error-message {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.success-message {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Links */
.terms-link {
    text-align: center;
    margin-top: 20px;
}

.terms-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

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

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

/* Scratchcard Page */
.scratch-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px 0;
}

.scratch-container {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.scratch-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 20px;
}

.scratchcard-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.scratchcard {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

#scratchCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    touch-action: none;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
}

.result {
    text-align: center;
    padding: 30px 20px;
    border-radius: 15px;
    margin-top: 20px;
}

.result.hidden {
    display: none;
}

.result-winner {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.result-winner h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.result-winner p {
    font-size: 16px;
}

.result-loser {
    background: #e0e0e0;
    color: #333;
}

.result-loser h2 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #666;
}

.result-loser p {
    font-size: 16px;
    color: #666;
}

/* Admin Styles - Soft UI Dashboard Design */
.admin-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-weight: 700;
}

.login-form {
    margin-top: 20px;
}

/* Admin Dashboard Layout - Sidebar Design */
.admin-page {
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 0 0 2rem 0 rgba(136, 152, 170, 0.15);
    z-index: 1000;
    overflow-y: auto;
}

.admin-sidebar-logo {
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.admin-sidebar-logo-text {
    font-weight: 700;
    font-size: 16px;
    color: #344767;
}

.admin-sidebar-nav {
    padding: 0 1rem;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #7b809a;
    margin: 1rem 0 0.5rem 0;
    padding: 0 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #344767;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 20px 0 rgba(102, 126, 234, 0.4);
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Main Content Area */
.admin-main {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
}

/* Top Navbar */
.admin-navbar {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.admin-navbar-left {
    flex: 1;
}

.admin-navbar-title {
    font-size: 20px;
    font-weight: 700;
    color: #344767;
    margin: 0;
}

.admin-navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-search {
    position: relative;
}

.admin-search input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    font-size: 14px;
    width: 300px;
    transition: all 0.3s;
}

.admin-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.admin-search::before {
    content: "🔍";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
}

.admin-navbar-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
}

.admin-navbar-icon:hover {
    background: #e9ecef;
}

.admin-user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.admin-user-menu:hover {
    background: #f8f9fa;
}

.admin-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* Content Container */
.admin-content {
    padding: 2rem;
}

.admin-breadcrumb {
    margin-bottom: 1.5rem;
}

.admin-breadcrumb a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

/* Admin Cards/Sections */
.admin-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s;
}

.admin-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.admin-section {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.admin-section h2 {
    margin-bottom: 1.5rem;
    color: #344767;
    font-size: 1.25rem;
    font-weight: 700;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.admin-section h3 {
    margin-bottom: 1rem;
    color: #344767;
    font-size: 1.1rem;
    font-weight: 600;
}

.campaign-form,
.upload-form {
    max-width: 600px;
}

.campaign-form .form-group,
.upload-form .form-group {
    margin-bottom: 20px;
}

.campaign-form label,
.upload-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.campaign-form input[type="checkbox"],
.upload-form input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

.campaign-form input[type="file"],
.upload-form input[type="file"] {
    padding: 8px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background: #f8f8f8;
}

.campaign-form input[type="file"]:hover,
.upload-form input[type="file"]:hover {
    border-color: #667eea;
}

.campaign-selector {
    max-width: 400px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 700;
    color: #344767;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table td {
    color: #67748e;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border-radius: 0.375rem;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #e9ecef;
    color: #344767;
}

.badge.success {
    background: linear-gradient(135deg, #2dce89 0%, #2dcecc 100%);
    color: white;
}

.badge.warning {
    background: linear-gradient(135deg, #fb6340 0%, #fbb140 100%);
    color: white;
}

/* Stats Grid - KPI Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin-bottom: 1rem;
}

.stat-card-title {
    font-size: 12px;
    font-weight: 700;
    color: #7b809a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #344767;
    margin-bottom: 0.25rem;
}

.stat-card-change {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card-change.positive {
    color: #2dce89;
}

.stat-card-change.negative {
    color: #f5365c;
}

.stat-item {
    padding: 15px;
    background: white;
    border-radius: 0.75rem;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.stat-item strong {
    display: block;
    margin-bottom: 5px;
    color: #667eea;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Background Grid */
.background-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.background-item {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.background-item img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}

.background-item p {
    font-size: 12px;
    margin-bottom: 10px;
    color: #666;
}

/* Links */
.link-small {
    font-size: 12px;
    color: #667eea;
    text-decoration: none;
}

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

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        max-width: 800px;
    }
    
    .admin-header .container {
        flex-wrap: nowrap;
    }
    
    .admin-header h1 {
        margin-bottom: 0;
    }
    
    #scratchCanvas {
        width: 400px;
        height: 400px;
    }
    
    .content-box {
        padding: 40px 30px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .data-table {
        font-size: 14px;
    }
}

/* Responsive Admin Sidebar */
@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-navbar {
        padding: 1rem;
    }
    
    .admin-search input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .admin-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-search {
        display: none;
    }
}

/* Touch Optimization */
@media (hover: none) {
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}

/* Print Styles */
@media print {
    .admin-header,
    .btn,
    .admin-breadcrumb {
        display: none;
    }
}

