/* css/style.css */

/* فونت Vazir از CDN */
@font-face {
    font-family: vazir;
    font-style: normal;
    font-weight: normal;
    src: url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-FD-WOL.eot');
    src: url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-FD-WOL.eot?#iefix') format('embedded-opentype'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-FD-WOL.woff2') format('woff2'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-FD-WOL.woff') format('woff'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-FD-WOL.ttf') format('truetype');
}

@font-face {
    font-family: vazirBold;
    font-style: normal;
    font-weight: bold;
    src: url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Bold-FD-WOL.eot');
    src: url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Bold-FD-WOL.eot?#iefix') format('embedded-opentype'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Bold-FD-WOL.woff2') format('woff2'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Bold-FD-WOL.woff') format('woff'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Bold-FD-WOL.ttf') format('truetype');
}

@font-face {
    font-family: vazirMedium;
    font-style: normal;
    font-weight: 500;
    src: url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Medium-FD-WOL.eot');
    src: url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Medium-FD-WOL.eot?#iefix') format('embedded-opentype'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Medium-FD-WOL.woff2') format('woff2'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Medium-FD-WOL.woff') format('woff'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Medium-FD-WOL.ttf') format('truetype');
}

@font-face {
    font-family: vazirLight;
    font-style: normal;
    font-weight: 300;
    src: url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Light-FD-WOL.eot');
    src: url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Light-FD-WOL.eot?#iefix') format('embedded-opentype'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Light-FD-WOL.woff2') format('woff2'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Light-FD-WOL.woff') format('woff'),
         url('https://gitcdn.ir/library/PersianFonts/vazir/Vazir-Light-FD-WOL.ttf') format('truetype');
}

/* Reset و تنظیمات پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: 15px; /* فونت کوچک‌تر برای DPI 430 */
}

body {
    font-family: 'vazir', sans-serif;
    background-color: #ffffff;
    color: #374151;
    line-height: 1.6;
    direction: rtl;
    font-weight: 400;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Card */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

/* Navigation */
.navbar {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    font-family: 'vazirMedium', sans-serif;
}

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

.nav-link {
    color: #4b5563;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-family: 'vazirMedium', sans-serif;
}

.nav-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.nav-link.active {
    background: #3b82f6;
    color: white;
    font-weight: 500;
}

/* Buttons */
.btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'vazirMedium', sans-serif;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-weight: 500;
    line-height: 1.5;
}

.btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-success {
    background: #10b981;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
}

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

.btn-secondary {
    background: #9ca3af;
}

.btn-secondary:hover {
    background: #6b7280;
}

.btn-small {
    padding: 5px 14px;
    font-size: 0.8rem;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    color: #4b5563;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'vazirMedium', sans-serif;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'vazir', sans-serif;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background: #ffffff;
    line-height: 1.5;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Alliance List */
.alliance-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.alliance-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.alliance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.alliance-name {
    font-size: 1rem;
    color: #111827;
    margin-bottom: 8px;
    font-weight: 600;
    font-family: 'vazirMedium', sans-serif;
    line-height: 1.4;
}

.alliance-description {
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.5;
    font-size: 0.85rem;
}

.alliance-info {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.alliance-treasury {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    margin: 12px 0;
    font-size: 0.9rem;
    font-family: 'vazirMedium', sans-serif;
}

/* Search */
.search-box {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    max-width: 320px;
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'vazir', sans-serif;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Coins Display */
.coins-display {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-family: 'vazirMedium', sans-serif;
}

/* Coin Icon */
.coin {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 50%;
    position: relative;
}

.coin::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* Alerts */
.alert {
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

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

.table th {
    background: #f9fafb;
    padding: 10px;
    text-align: right;
    color: #4b5563;
    font-weight: 600;
    font-family: 'vazirMedium', sans-serif;
    border-bottom: 1px solid #e5e7eb;
}

.table td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    line-height: 1.5;
}

.table tr:hover {
    background: #f9fafb;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'vazirMedium', sans-serif;
    color: #111827;
    line-height: 1.3;
}

h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Utility Classes */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-center {
    text-align: center;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .card {
        padding: 18px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .alliance-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    html {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 6px 16px;
        font-size: 0.8rem;
    }
    
    .form-input {
        padding: 7px 10px;
    }
    
    .alliance-card {
        padding: 14px;
    }
}

/* Focus Styles */
*:focus {
    outline: none;
}

.btn:focus,
.form-input:focus,
.nav-link:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Selection */
::selection {
    background-color: #3b82f6;
    color: white;
}